Re: [PATCH] barrier patch set

From: Bartlomiej Zolnierkiewicz
Date: Sat Mar 20 2004 - 11:58:43 EST


On Saturday 20 of March 2004 17:32, Chris Mason wrote:
> 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.

For low-level driver it shouldn't really matter whether sectors to be
written are the commit block for a transaction or the previous log blocks
and in the current implementation it does matter.

> We end up with a log blocks, pre-flush, commit block, post-flush cycle,
> which is what gives the proper transaction ordering on disk.

Jens, can you explain how this translates to the block layer?
If "log blocks" is a separate request from "commit block",
we can just do: log blocks, flush, commit block, flush cycle.

> For data blocks we only need the post flush, which is why Jens made
> blkdev_issue_flush skip the pre-flush.

Yes.

Thanks,
Bartlomiej

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