Re: Ordered block writes

Jeremy Fitzhardinge (jeremy@zip.com.au)
Tue, 03 Feb 1998 13:00:37 +1100


Rik van Riel wrote:
>
> On Sun, 1 Feb 1998, Jeremy Fitzhardinge wrote:
>
> > (obviously) happen after all other writes are on disk. A sync()
> > super_operations entry would help, which would let the filesystem set
> > its own write orders.
>
> What might be even better is some counter# for each syncable
> block, and a type indication.

Well, I don't see there being any particular distinction between
"ordered writes" and "unordered writes". All writes are ordered, but
sometimes it doesn't matter. In this case, writes where the order
doesn't matter would all have the same sequence number. Unfortunately
using a global sequence number introduces global ordering, whereas there
may only be a requirement for partial ordering (eg, data before its
inode, but the sequence in relation to other inode updates doesn't
matter); still, it's better than nothing.

> Then, when we sync-write an ordered write, the buffercache
> will have to scan the buffers for lower-numbered buffers from
> the same device.

There's no requirement that any of the writes be synchronous. In fact,
that's kind of the point of giving the buffercache the information to
get it right for itself. One could use completion callbacks to track
the state of what's actually been written, and what's still pending.

> This might be:
> - cheap
> - easy to implement, and thus relatively bug-free and stable

Cool. All that needs to happen now that someone do it. I'll consider
it, but I was rather hoping someone has something up their sleeve.

J