> By the way , when there is a "normal" FS on a "normal" block device,
> does the data get cached twice, once in buffer-cache and once in
> page-cache ?
No, I believe the buffer cache uses the page cache. When requesting data,
bread( ) first maps the block with foo_bmap( ), then requests the page
data with foo_readpage( ). If the page is already cached, the kernel
simply increments the page reference count (later decremented by
copy_to_user() and returns the page reference. If the page is not cached,
it reads it from the device.
The purpose of the buffer cache is not to physically hold the page data.
Its major responsibility is read ahead.
However, there is a possibility that the data is doubly cached... once by
the low level device driver and once by the page cache. However, this is
not a problem because the device cache is much less stagnant.
JM
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/
This archive was generated by hypermail 2b29 : Sat Jan 15 2000 - 21:00:22 EST