Open Bug 1814815 Opened 1 year ago Updated 1 year ago

Coalesce madvise calls until after sweeping

Categories

(Core :: JavaScript: GC, enhancement, P1)

enhancement

Tracking

()

ASSIGNED

People

(Reporter: pbone, Assigned: pbone)

References

(Blocks 3 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().

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.

Depends on: 1816340
Blocks: 1814817
Whiteboard: [sp3]
Depends on: 1820686
No longer depends on: 1820686
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: