Re: page locking from application

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 21 Jul 2006, Mulyadi Santosa wrote:

> > Is it possible to do some kind of page locking or pinning from
> > application, so that kernel doesn't swap out the page as long as
> use mmap(MAP_NORESERVE) to make the user mode pages unswappable...

Wrong. MAP_NORESERVE tells kernel not to reserve space in swap space for 
this mapping (which is otherwise done, so that the page could be safely 
swapped out when needed). In case you have a MAP_NORESERVE mapping and you 
try to write into it when the system is low on memory, you will get 
segfault.

mlock() makes user pages nonswappable. But it needs root privileges to do 
so.

-- 
JiKos.

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux