Mailing List Archive

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

Re: [tlug] Possible command to boost to laptop performance

Josh Glover writes:
 > On 3 November 2010 13:06, Edward Middleton
 > <> wrote:
 > > On 11/03/2010 07:04 PM, Marty Pauley wrote:
 > >
 > >> I would have thought it would perform _worse_ just after you flush all
 > >> the cache, since the cache is there to improve performance.
 > >
 > > If your applications have exhausted all available memory and are running
 > > on swap, more aggressive culling of the cache might improve performance ;)
 > I thought the kernel was smart enough to back off the caching as
 > memory pressure on the system increased.

It's not a question of "smart", it's a question of "dumb enough to be
genius".  The idea is that you populate memory with slabs of anything
you think might be useful (next pag(s)e of a file just read, typically,
or perhaps something mmap'ed but not yet accessed) at the lowest
possible priority.  If you run out of memory, the cache automatically
gets reduced: it's just low-priority allocation.

So the cache needs no culling, and backing off is similarly
unnecessary.  All the interesting questions of cache management, then,
are on the front end:  what's likely to be useful?

I suppose that if the kernel makes very bad decisions about what to
put in the cache, flushing it might make room for more pages from the
most recently accessed resources, and this locality might do a better
job of populating the cache.

Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links