Closed Bug 870541 Opened 12 years ago Closed 7 years ago

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

Categories

(Core :: XPConnect, defect, P2)

All
Gonk (Firefox OS)
defect

Tracking

()

RESOLVED INCOMPLETE
blocking-b2g -
Tracking Status
b2g18 + affected

People

(Reporter: bent.mozilla, Unassigned)

References

Details

(Keywords: perf, 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? → -
tracking-b2g18: --- → +
Whiteboard: c=
Keywords: perf
Whiteboard: c= → c= ,
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
See Also: → 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
Closed: 7 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.