Prioritise running GC tasks on helper threads

RESOLVED FIXED in Firefox 55



JavaScript Engine
a year ago
a year ago


(Reporter: jonco, Assigned: jonco)


(Blocks: 1 bug)

55 Branch

Firefox Tracking Flags

(firefox55 fixed)



(1 attachment)



a year ago
Jan, I seem to remember you brought this up a while ago.

The current helper thread setup makes GC parallel tasks the lowest priority and will schedule any other kind of task before them.  This could lead to helper thread tasks from one runtime delaying GC tasks for another runtime and causing user-visible pauses.  We really want the GC tasks to get executed as soon as possible.


a year ago
Blocks: 1351769
Perhaps beyond the scope of this bug, but if helper thread scheduling is an issue, perhaps we should consider budgeting background GC tasks similar to how we budget them on the foreground. I imagine delaying a JIT compilation for a few milliseconds isn't necessarily a big deal, but if we hold it up for too long it could be an issue.

Of course, that's assuming there can be enough background GC tasks to block all threads in the pool - and I don't know how easy or hard it would be to incrementalize these tasks.

Comment 2

a year ago
(In reply to Emanuel Hoogeveen [:ehoogeveen] from comment #1)
> Of course, that's assuming there can be enough background GC tasks to block
> all threads in the pool

When we start sweeping a group of zones we fire of lots of GC parallel tasks for sweeping the various tables.  There are more than enough to use all threads in the pool.

Incrementalising these tasks is something we are going to look at, but for now the easiest way forward is to make the parallel execution work.

Comment 3

a year ago
Created attachment 8862817 [details] [diff] [review]

Patch to test for GC tasks first.
Attachment #8862817 - Flags: review?(jdemooij)
Comment on attachment 8862817 [details] [diff] [review]

Review of attachment 8862817 [details] [diff] [review]:

Makes sense.
Attachment #8862817 - Flags: review?(jdemooij) → review+

Comment 5

a year ago
Pushed by
Prioritise GC parallel tasks when selecting tasks to run on helper threads r=jandem

Comment 6

a year ago
Last Resolved: a year ago
status-firefox55: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in before you can comment on or make changes to this bug.