Experimental pmap optimizations

Matthew Dillon has created an experiment: shared page table mappings.  It’s controlled by a sysctl, since it’s still experimental.  The real-world effect is reducing the number of memory faults as a process uses up memory, and decreasing the overall memory usage.  The obvious benchmark is Postgres speed; this makes the initial expansion of memory usage much less of an drag on speed due to a high memory fault rate.

If all this mention of faulting sounds like a problem, remember memory faults on BSD are normal; that’s how programs indicate they need more memory space by causing a fault.  This is in contrast to Linux, where memory is allocated a different way.  Or at least, that’s my understanding.  (If you know better, please comment.)

2 Replies to “Experimental pmap optimizations”

  1. I thought a page fault, on both Linux and BSD, was a request for a page that exists in virtual memory but not loaded in real memory — i.e. it’s swapped out. And indeed it is normal on both BSD and Linux, but it is not a request for “more memory space” — it is request for a memory page that has already been allocated but, probably, not used in a while. Or does it mean something different in BSD?

  2. No, you’re probably right. I recall that memory faults are much more ‘lightweight’ on BSD than on Linux, but I’d feel a lot better if I could find the source for that thought.

Comments are closed.