Subject: Re: buffer cache memory management revision
To: Paul Kranenburg <firstname.lastname@example.org>
From: Chuck Silvers <email@example.com>
Date: 12/01/2003 09:35:16
On Sun, Nov 30, 2003 at 09:49:29PM +0100, Paul Kranenburg wrote:
> Here's a complete set of patches for the new buffer cache memory
> allocation scheme, including MD changes for all platforms.
one potential problem here: we shouldn't ever put the pagedaemon to
sleep waiting for memory which is created by the pagedaemon. this
wasn't a problem before since the buffer cache memory was made available
for reuse in a different buffer by brelse(), ie. usually when i/o completed.
in your diff, the buffer cache competes with other VM-managed memory users
for pages, so there's no guarantee on when more memory for buffers will
become available if the pagedaemon is put to sleep.
one way to fix this would be to use pools for all buffer-cache memory,
and set low watermarks for all of these pools. then we need to move
the call to pool_drain() to a separate thread so that it can free up
pool memory even if the normal thread is blocked waiting for memory.
(then eventually we need to fix pool_drain() so that it will never sleep,
but that appears not to be a big problem in practice.)