Messages in this thread | | | Date | Wed, 30 Jun 2004 10:29:40 +0200 | From | Helge Hafting <> | Subject | Re: Block Device Caching |
| |
Timothy Miller wrote:
> > > Markus Schaber wrote: > >> This lead us to the conclusion that block devices do not cache, but the >> filesystem does. But subsequently, I ran some tests on my developer >> machine (Pentium 4 Mobile Laptop). > > > > I had kernel experts repeatedly insist to me that block devices were > cached, while all of my tests (using dd to or from, say, /dev/sda1 or > whatever) indicated that there was absolutely no caching whatsoever.
Well, any cache is dropped when the device is closed. "dd" closes the device when it finishes.
Try a program that reads the same two blocks (spaced videly apart) over and over from the same open file descriptor. With _no_ caching you'll see the drive seeking all the time. With caching, you won't.
Helge Hafting - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |