Open Bug 1926480 Opened 4 months ago Updated 3 months ago

Consider scheduling IonFreeTask's during Idle time

Categories

(Core :: JavaScript Engine, defect, P3)

defect

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.

I wrote a prototype to do this earlier this year which showed about a 1% improvement on Android. I can retest.

Assignee: nobody → dpalmeiro
See Also: → 1926478
Whiteboard: [js-perf-next]
Severity: -- → S3
Priority: -- → P3

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.

Whiteboard: [js-perf-next] → [js-perf-next][sp3]
Whiteboard: [js-perf-next][sp3] → [sp3]

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.

I wonder if we could null out (or just stop tracing?) those edges when we create the IonFreeTask.

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

Another explanation: maybe the delayed IonFreeTasks running in idle time slow down the GC's parallel tasks?

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?

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

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: