Re: [PATCH] barrier patch set
From: Chris Mason
Date: Sat Mar 20 2004 - 11:32:20 EST
On Sat, 2004-03-20 at 11:23, Bartlomiej Zolnierkiewicz wrote:
> > > - why are we doing pre-flush?
> >
> > To ensure previously written data is on platter first.
>
> I know this, I want to know what for you are doing this?
>
> Previously written data is already acknowledgment to the upper layers so you
> can't do much even if you hit error on flush cache. IMO if error happens we
> should just check if failed sector is of our ordered write if not well report
> it and continue. It's cleaner and can give some (small?) performance gain.
>
The journaled filesystems need this. We need to make sure that before
we write the commit block for a transaction, all the previous log blocks
we're written are safely on media. Then we also need to make sure the
commit block is on media.
We end up with a log blocks, pre-flush, commit block, post-flush cycle,
which is what gives the proper transaction ordering on disk.
For data blocks we only need the post flush, which is why Jens made
blkdev_issue_flush skip the pre-flush.
-chris
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/