Re: [PATCH] barrier patch set

From: Chris Mason
Date: Wed Mar 31 2004 - 17:11:37 EST


On Wed, 2004-03-31 at 16:26, Jeff Garzik wrote:
>
> > Yes, it gets ugly in a hurry. Jeff, look at the whole thread about the
> > O_DIRECT read vs buffered write races. I don't think we can use FUA for
>
> Yes, I'm aware of the thread...
>
>
> > fsync or O_SYNC without using it for every write.
>
> Why not for O_SYNC? Is some crazy userspace application flipping this
> bit on and off rapidly?
>

For both fsync and O_SYNC, the pages we want to write synchronously are
also available for some other part of the kernel to write async. Since
we do know the write is going to be O_SYNC when we are marking the pages
dirty, we could mark them dirty_fua or something as well.

Even assuming we can deal with the data=ordered ext3/reiserfs issues, it
makes the writeback for O_SYNC yet another corner case to check, and one
where we have no useful way to make sure the fua bit really got set on
all the writes for a given O_SYNC (unless we pin the page and check each
one after the writes are complete).

Since O_DIRECT is much less complex I think we should start there.

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