Tuesday 22 November 2011

Page faults


Major page faults: swapped out pages having to be swapped back in from disk
Minor page faults: marking a required page in memory as being in memory

mlockall results in all pages mapped by a process to remain resident in memory

#include <sys/mman.h>


int mlockall(int flags);
int munlockall(void);

flags:
MCL_CURRENT: Lock all of the pages currently mapped into the address space of the process.
MCL_FUTURE: Lock all of the pages that become mapped into the address space of the process in the future, when those mappings are established.

prefaulting in the stack will prevent minor page faults.
push and then pop a large block of data onto the stack at the start of a thread

No comments:

Post a Comment