Skip to contentSkip to conversation

page cache and buffer cache in 2.4.18 and up

DISCUSSION Amir Hermelin 2 participants 2 messages Sep 11, 2003

lore
Share & tools
lore
#0 lore raw

Hi,
Since the change in kernel 2.4, read and writes go both through the page and buffer cache. 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?

Thanks,
Amir.

#1 lore raw
Quoted 3 lines · Amir Hermelin

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)

Quoted 3 lines

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?