Re: Ability to limit or disable page caching?

From: Rik van Riel
Date: Mon May 05 2008 - 16:45:02 EST


On Mon, 5 May 2008 12:42:31 -0700
"Kevin Burton" <burton@xxxxxxxxxxxx> wrote:

> What's happening is that the kernel is deciding to swap out some
> memory to disk in the (false) belief that it can free some up for
> cache.
>
> The problem is my database is already using its own cache so these are
> conflicting philosophies here which make Linux perform in a
> pathological way..

One of the problems is that the process pages (anonymous memory) and
page cache pages live on the same LRU, so the kernel cannot always
easily find the page cache pages when it is trying to evict something.

Once that is fixed, and replacement is biased towards evicting page
cache pages, the system may do the right thing by itself.

I realize that this is no quick fix for your issue, but I am working
on a split LRU patch series to make sure Linux does the right thing in
the future.

You can find the latest patch at http://people.redhat.com/riel/splitvm/
and info on the design at http://linux-mm.org/PageReplacementDesign

> What I want to do is either disable the page cache entirely or just
> tell the OS to cache at max 10% of the available memory.

I have no such tunable in my code (yet), because I would like the
kernel to do the right thing automatically. I will post a 2.6.25 based
kernel RPM for Fedora 9 soon with the split LRU patch series applied.
If you feel like testing/breaking it, I would be interested to see if
it does indeed do the right thing for your workload or if it needs more
tuning.

--
All Rights Reversed
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/