Closed Bug 1360502 Opened 3 years ago Closed 3 years ago

Prioritise running GC tasks on helper threads


(Core :: JavaScript Engine, enhancement)

55 Branch
Not set



Tracking Status
firefox55 --- fixed


(Reporter: jonco, Assigned: jonco)


(Blocks 1 open bug)



(1 file)

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.
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.
(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.
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+
Pushed by
Prioritise GC parallel tasks when selecting tasks to run on helper threads r=jandem
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in before you can comment on or make changes to this bug.