18–20 Sept 2024
Europe/Vienna timezone

Madvise lazy free

20 Sept 2024, 16:00
15m
"Hall L1" (Austria Center)

"Hall L1"

Austria Center

135
Kernel Memory Management MC Kernel Memory Management MC

Speaker

Rik van Riel (Facebook)

Description

Conventional wisdom has held that madvise overhead has been mostly the syscall overhead. However, profiling shows this not to be the case.

Even on a medium sized 1 socket system, about half the CPU time spent in MADV_DONTNEED is spent flushing the TLB, and that is just in the calling CPU. Add in handling of the TLB flush IPIs on the other CPUs, and 90-95% of the MADV_DONTNEED overhead is TLB flushes.

I would like to propose MADV_LAZY_FREE, which can avoid most of the TLB flush overhead through collaborative behavior with the malloc library, and some inspiration from RCU.

Primary author

Rik van Riel (Facebook)

Presentation materials