Lightweight Guard Pages For Linux Showing 5x Speed-Up For Memory Mapping Invocations (www.phoronix.com)
from petsoi@discuss.tchncs.de to linux@lemmy.ml on 20 Oct 11:52
https://discuss.tchncs.de/post/23891686

Userland library functions such as allocators and threading implementations often require regions of memory to act as ‘guard pages’ - mappings which, when accessed, result in a fatal signal being sent to the accessing process.

The current means by which these are implemented is via a PROT_NONE mmap() mapping, which provides the required semantics however incur an overhead of a VMA for each such region.

With a great many processes and threads, this can rapidly add up and incur a significant memory penalty. It also has the added problem of preventing merges that might otherwise be permitted.

This series takes a different approach - an idea suggested by Vlasimil Babka (and before him David Hildenbrand and Jann Horn - perhaps more - the provenance becomes a little tricky to ascertain after this - please forgive any omissions!) - rather than locating the guard pages at the VMA layer, instead placing them in page tables mapping the required ranges.https://lore.kernel.org/…/cover.1729196871…

#linux

threaded - newest