LWN.net Logo

mlock

mlock

Posted May 8, 2004 17:44 UTC (Sat) by giraffedata (subscriber, #1954)
In reply to: 2.6 swapping behavior by abatters
Parent article: 2.6 swapping behavior

Actually, mlock is conceptually exactly what's required here. We're talking about a case where the following assumption inherent in real memory allocation policy fails: the pages for which fast access will be most appreciated are those that were most recently used.

Here, we have a user who is willing to let 32MB of memory sit idle overnight, even at the cost of slowing down other things, just so he can have immediate response every time he clicks his web browser. That's what mlock is about.

I do a similar (but rather opposite) thing with a ramdisk. I copy various files that are used in tasks that I want to be responsive into a ramdisk. Ramdisk is just file cache that is locked in memory. That way, no matter how much memory pressure there has been since the last time I used these files, they're always right there when I click for them.


(Log in to post comments)

Copyright © 2012, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds