B2G: Slow script mechanism uses wall clock time, could cause lower priority background processes to have scripts aborted

RESOLVED INCOMPLETE

Status

()

Core
XPConnect
P2
normal
RESOLVED INCOMPLETE
5 years ago
2 months ago

People

(Reporter: Ben Turner (not reading bugmail, use the needinfo flag!), Unassigned)

Tracking

({perf})

unspecified
All
Gonk (Firefox OS)
Points:
---

Firefox Tracking Flags

(blocking-b2g:-, b2g18+ affected)

Details

(Whiteboard: [c= p= s= u=])

While chatting about bug 870043 jlebar realized that we could be shooting ourselves in the foot here. The slow script mechanism uses wall clock time and that could cause lower priority background processes to have their scripts aborted even though they haven't really run for very long. We need something better, maybe counting js instructions or per-thread CPU time?
blocking-b2g: --- → leo?
Since nobody looks at the "Platform" field: This bug is specifically about b2g.
Summary: Slow script mechanism uses wall clock time, could cause lower priority background processes to have scripts aborted → B2G: Slow script mechanism uses wall clock time, could cause lower priority background processes to have scripts aborted
This sounds like a useful enhancement but not something we'd block release on without partner request for it.  We can track, and look at an uplift nomination when one is ready.  Also putting c= to get this into scrum backlog.
blocking-b2g: leo? → -
status-b2g18: --- → affected
tracking-b2g18: --- → +
Whiteboard: c=

Updated

5 years ago
Keywords: perf
Whiteboard: c= → c= ,

Updated

5 years ago
Priority: -- → P2
I can have a look at this one.
Assignee: nobody → hub
Ben,

Since bug 870043 comment 31, the slow script watchdog has been disabled on B2G. Is that bug still valid?
Flags: needinfo?(bent.mozilla)
My understanding was that it was disabled on the b2g-18 branch but it's still enabled for b2g on trunk, and will remain so after bholley fixes up the watchdog mechanism in bug 870043.
(In reply to Johnny Stenback (:jst, jst@mozilla.com) from comment #5)
> My understanding was that it was disabled on the b2g-18 branch but it's
> still enabled for b2g on trunk, and will remain so after bholley fixes up
> the watchdog mechanism in bug 870043.

Yeah. That bug is just waiting for inbound to open, and then it'll land.
Flags: needinfo?(bent.mozilla)
Do we have a JS "tick" that would be available to use? I couldn't find anything in the documentation or the code.

Nor could I find something that could give me the "cpu time" in the thread APIs.
Bobby, do you have an idea or do you know who might have? (comment 7)

Thanks.
Flags: needinfo?(bobbyholley+bmo)
I have no idea. Kyle might know.
Flags: needinfo?(bobbyholley+bmo) → needinfo?(khuey)
I don't understand the question.  What does "tick" mean?
Flags: needinfo?(khuey)
Tick is something about elapsed time (clock ticking). I don't really know how you'd call it.

To know if the JS runtime has done something, unrelated to actual elapsed time from the clock, because we my not run all the time.
Ok, you should ask the JS team then.  Not sure why bholley needinfoed me ...
The JS engine doesn't really have a way to measure time than actual elapsed time.
Thanks. I was afraid that this was the case.
I think it is a bit out of are of expertise and think that this should be handled by the JS team.
Assignee: hub → nobody

Updated

4 years ago
See Also: → bug 870043
Whiteboard: c= , → [c= p= s= u=]
Hi Ben, since bug 870043 resolved some of the watchdog timer issues, is this bug still an issue?
Flags: needinfo?(bent.mozilla)
Yes, as far as I know the issue is unresolved. The slow script dialog relies on wall clock time and we have no way to know if any actual work was done between two arbitrary wall clock times.
Flags: needinfo?(bent.mozilla)
Status: NEW → RESOLVED
Last Resolved: 2 months ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.