On Fri, 21 Jul 2006, Parav Pandit wrote: > mlock() is the solution. I was actually trying to understand the mlock > system call implementation to find out how the pages are locked in the > RAM so that they are not pagged out. But I could not find any such thing > in code walk through of sys_mlock(). > Question: > Page locking is handled in software or in MMU? > I don't find any bit in the PTE (Page table entry) for > page saying it to be locked. It is handled in software. Each VMA region has a flag VM_LOCKED, which indicates whether the given VMA is locked into memory or not (this flag is set for corresponding VMA in the mm/mlock.c:do_mlock()). This flag is then taken into account by swapper code, which doesn't consider the pages with VM_LOCKED flag for swapout - see mm/rmap.c:try_to_unmap_one(), which contains the corresponding test on the VMA). -- JiKos. -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/