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)