Re: page cache and buffer cache in 2.4.18 and up

From: Mike Fedyk
Date: Thu Sep 11 2003 - 12:44:09 EST


On Thu, Sep 11, 2003 at 05:30:05PM +0200, Amir Hermelin wrote:
> Hi,
> Since the change in kernel 2.4, read and writes go both through the page and
> buffer cache.

That change was in 2.4.10 with the andrea VM merge. Though, I wouldn't use
it until about 2.4.14/16+ (don't use 2.4.15)

> Is the cached data held twice (i.e. uses twice the memory)? I
> noticed that the struct page holds a pointer to a buffer-head list; does
> that list contain actual data, or just pointers into the cached page data?

Others have asked before about this.

But let me inject some hearsay:
With the buffer & pagecache merge patch, there is much less duplication of
data, but still some. Also, pagecache doesn't reference into buffer cache
and the same data can be read twice (ie, if you're reading directly from
/dev/hda, and a filesytem on /dev/hdaX at the same time).

There is less duplication in 2.6, but I believe pagecache still doesn't
reference to buffer cache in there too.

Can someone say in more detail?
-
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/