Coalesce madvise calls until after sweeping
Categories
(Core :: JavaScript: GC, enhancement, P1)
Tracking
()
People
(Reporter: pbone, Assigned: pbone)
References
(Blocks 4 open bugs)
Details
(Keywords: perf:responsiveness, Whiteboard: [sp3])
Attachments
(2 files)
jemalloc can Coalesce madvise()
calls on dirty pages, but it tries to do a bit of this after each call to free()
. A workload that does a lot of free()
like GC sweeping can make fewer system calls if it waits until after sweeping is done to madvise
its dirty pages due to finding more adjacent pages.
This also means that jemalloc's arena lock is held less and other threads are less likely to block during malloc()
.
Assignee | ||
Comment 1•2 years ago
|
||
We must hold the arena lock while calling madvise so that our record of what
is madvised and what isn't is consistent with the OS. But we can batch
these operations until after the JS GC has completed sweeping which combines
more system calls and doesn't block the arena lock for so long.
Assignee | ||
Comment 2•2 years ago
|
||
Here are some results. Note that due to Bug 1816249 the Linux results are invalid.
Assignee | ||
Comment 3•2 years ago
|
||
Depends on D166778
Updated•2 years ago
|
Updated•2 years ago
|
Description
•