Re: DVD blockdevice buffers

From: Linus Torvalds (torvalds@transmeta.com)
Date: Wed May 23 2001 - 15:01:56 EST


On Wed, 23 May 2001, Stephen C. Tweedie wrote:
> > that the filesystems already do. And you can do it a lot _better_ than the
> > current buffer-cache-based approach. Done right, you can actually do all
> > IO in page-sized chunks, BUT fall down on sector-sized things for the
> > cases where you want to.
>
> Right, but you still lose the caching in that case. The write works,
> but the "cache" becomes nothing more than a buffer.

No. It is still cached. You find the buffer with "page->buffer", and when
all of them are up-to-date (whether from read-in or from having written
to them all), you just mark the whole page up-to-date.

This _works_. Try it on ext2 or NFS today.

Now, it may be that the preliminary patches from Andrea do not work this
way. I didn't look at them too closely, and I assume that Andrea basically
made the block-size be the same as the page size. That's how I would have
done it (and then waited for people to find real life cases where we want
to allow sector writes).

So in short: the page cache supports _today_ all the optimizations. In
fact, you can, on NFS, do 4096 one-byte writes, and they will be (a)
coalesced into one write over the wire, and (b) will be cached in the page
and the page marked up-to-date.

                Linus

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



This archive was generated by hypermail 2b29 : Wed May 23 2001 - 21:00:53 EST