RE: Buffer cache

Leeuw van der, Tim (tim.leeuwvander@nl.unisys.com)
Fri, 11 Aug 2000 08:50:53 -0500


Well... I'm not an expert of any kind re. kernel-code :-)

The reason I replied was that the original poster seemed to be confused
about kernel-level data caches vs. application-level data caches; I felt
confident enough about my knowledge to try explain that difference without
worrying too much about buffer-cache vs. page-cache.

I hope my ignorance will be forgiven! :-)

--Tim

-----Original Message-----
From: Tigran Aivazian
To: Leeuw van der, Tim
Cc: 'linux-kernel@vger.rutgers.edu'; 'kay@hni.uni-paderborn.de'
Sent: 8/11/00 3:34 PM
Subject: Re: Buffer cache

On Fri, 11 Aug 2000, Leeuw van der, Tim wrote:
> If you write the new data to disk with the write() statement, the
write will
> go thru the buffercache

no, it won't actually, for most (all?) filesystems. Have you checked the
code? Most filesystems set their ->write() method to
generic_file_write()
which means writes go through page cache and not buffer cache.

The buffer cache is used mainly for metadata things like getting the
correct disk block containing a given inode per given i_ino etc.

(I am talking only about latest kernels, of course)

So, the answer to his question depends on lots of things (like
readahead)
and the next read() may or may not actually cause some io from disk to
happen.

Regards,
Tigran

-
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/