Re: [PATCH] 2.4.x write barriers (updated for ext3)

Stephen C. Tweedie
2002-02-22T14:19:54Z

Hi,

On Thu, Feb 21, 2002 at 06:30:20PM -0500, Chris Mason wrote:

> This makes it much easier to add support for ide writeback
> flushing to things like ext3 and lvm, where I want to make
> the minimal possible changes to make things safe.

Nice.

> There might be additional spots in ext3 where ordering needs to be
> enforced, I've included the ext3 code below in hopes of getting
> some comments.

No. However, there is another optimisation which we can make.

Most ext3 commits, in practice, are lazy, asynchronous commits, and we
only nedd BH_Ordered_Tag for that, not *_Flush. It would be easy
enough to track whether a given transaction has any synchronous
waiters, and if not, to use the async *_Tag request for the commit
block instead of forcing a flush.

We'd also have to track the sync status of the most recent
transaction, too, so that on fsync of a non-dirty file/inode, we make
sure that its data had been forced to disk by at least one synchronous
flush.

But that's really only a win for SCSI, where proper async ordered tags
are supported. For IDE, the single BH_Ordered_Flush is quite
sufficient.

Cheers,
Stephen