Consider scheduling IonFreeTask's during Idle time
Categories
(Core :: JavaScript Engine, defect, P3)
Tracking
()
People
(Reporter: denispal, Assigned: denispal)
References
(Blocks 1 open bug)
Details
(Whiteboard: [sp3])
Attachments
(1 file)
IonFreeTasks cause a lot of malloc lock contention with the main thread. See https://bugzilla.mozilla.org/show_bug.cgi?id=1926478#c1. It might be a good idea if we can push these tasks to Idle.
Assignee | ||
Comment 1•4 months ago
|
||
I wrote a prototype to do this earlier this year which showed about a 1% improvement on Android. I can retest.
Updated•4 months ago
|
Updated•4 months ago
|
Assignee | ||
Comment 2•3 months ago
|
||
Assignee | ||
Comment 3•3 months ago
|
||
I posted a patch to do this, but it doesn't seem very fruitful anymore so it might not be worth it. It could be useful revisiting later, but implementing bug 1913757 seems like a better approach.
Updated•3 months ago
|
Updated•3 months ago
|
Updated•3 months ago
|
Assignee | ||
Comment 4•3 months ago
|
||
It appears that the reason the attached patch isn't helping is because it keeps a lot of GC things alive which increases the marking time. We reduce time in malloc locks but increase GC time as compensation.
Comment 5•3 months ago
|
||
I wonder if we could null out (or just stop tracing?) those edges when we create the IonFreeTask.
Comment 6•3 months ago
|
||
It's a bit surprising because the compile tasks that we're batching to be freed shouldn't get traced anymore (they're not in any of the helper thread task lists or the lazy-link list, and those are the places where we trace compile tasks).
Comment 7•3 months ago
|
||
Another explanation: maybe the delayed IonFreeTasks running in idle time slow down the GC's parallel tasks?
Assignee | ||
Comment 8•3 months ago
|
||
I was a bit mistaken. Looking at the comparison report again, the increase in time is actually coming from the CC during CCGraphBuilder::BuildGraph
: https://share.firefox.dev/3OhAXHi. It looks like this increases by 1.8x during the Angular test. I've put the idle tasks into a new task list in the patch, but I'm not tracing that list anywhere. Will the CC graph builder still iterate through the edges in the IonCompileTask, maybe through the TempAllocator or somewhere else?
Comment 9•3 months ago
|
||
(In reply to Denis Palmeiro [:denispal] from comment #8)
Will the CC graph builder still iterate through the edges in the IonCompileTask, maybe through the TempAllocator or somewhere else?
No it's just memory waiting to be freed. If something was still accessing these tasks it would be racing with off-thread freeing so we likely would have noticed. Interaction with jemalloc or hardware effects (caches getting evicted?) are the main things I can think of.
Description
•