LWN.net Logo

2.6 swapping behavior

2.6 swapping behavior

Posted May 6, 2004 17:05 UTC (Thu) by guinan (subscriber, #4644)
Parent article: 2.6 swapping behavior

I've felt this - it is highly annoying when I come down to continue my work in the morning, and each of the 8 tabs in my Galeon window takes 10 seconds to page back in because updatedb and various other things that have no business leaving pages in the cache ran overnight.

I will try setting swappiness to 0, but why couldn't the kernel let processes provide a hint about page cache policy themselves? It would take a while for applications to catch up, but it keeps policy in userspace, on a per-application basis, instead of leaving it up to heuristics in the kernel. Examples,

updatedb,makewhatis,etc. - DISPOSABLE
galeon,evolution,etc. - INTERACTIVE

Use an ioctl(), /proc/self/ entry, whatever.

-Jamie


(Log in to post comments)

2.6 swapping behavior

Posted May 6, 2004 19:31 UTC (Thu) by abatters (✭ supporter ✭, #6932) [Link]

Well, there is mlock() et al., but that would be like trying to swat a fly with a sledgehammer.

After closing a memory-hog program that was causing swapping, sometimes I just do "swapoff -a; swapon -a" to get the system responsive again.

mlock

Posted May 8, 2004 17:44 UTC (Sat) by giraffedata (subscriber, #1954) [Link]

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.

2.6 swapping behavior

Posted May 13, 2004 16:50 UTC (Thu) by jonsmirl (guest, #7874) [Link]

What about simply adding "swapoff -a; swapon -a" to the end of updatedb and prelink chron scripts?

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