GJones wrote:I wonder if there's any way to tell Linux what to cache, e.g. tell it to prefer keeping Firefox libs in RAM instead of other random stuff? I'm thinking sort of along the lines of Windows XP's adaptive prefetching, only simpler and dumber.
No, I don't think that's possible.
Whenever data is accessed which is not yet cached that data is read from disk and some algorithm decides which data to drop if there's no free space anymore. Usually little used, old pages are preferably dropped. So unless you're low on memory the stuff you currently need like firefox libs should stay in memory. If you're getting out of memory those cached pages might get dropped or swapped. This is especially bad if you have even less memory and the system starts swapping application data (no chance to drop those pages as they might contain the mail you're currently writing or ....), which means lots of swapping and disk accesses start to happen. That last scenario can quickly create the impression of an unresponsive system. Your CPU then feels like a giant factory running out of its supplies brought in by a small, tiny road.
Apart prefetching is a different technique, that aims at caching data before it's actually needed. So only a first time start may benefit. It especially offers little benefit on low-memory systems as on those the almost inexistent caches are filled up quickly anyway.