Prioritise running GC tasks on helper threads

RESOLVED FIXED in Firefox 55

Status

()

Core
JavaScript Engine
RESOLVED FIXED
a year ago
a year ago

People

(Reporter: jonco, Assigned: jonco)

Tracking

(Blocks: 1 bug)

55 Branch
mozilla55
Points:
---

Firefox Tracking Flags

(firefox55 fixed)

Details

Attachments

(1 attachment)

(Assignee)

Description

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.
(Assignee)

Updated

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.
(Assignee)

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.
(Assignee)

Comment 3

a year ago
Created attachment 8862817 [details] [diff] [review]
bug1360502-prioritise-gc-tasks

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

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

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

Comment 5

a year ago
Pushed by jcoppeard@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/af0598e94338
Prioritise GC parallel tasks when selecting tasks to run on helper threads r=jandem

Comment 6

a year ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/af0598e94338
Status: NEW → RESOLVED
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.