[Top] [All Lists]

Re: Device loses barrier support (was: Fixed patch for simple barriers.)

To: Mikulas Patocka <mpatocka@xxxxxxxxxx>
Subject: Re: Device loses barrier support (was: Fixed patch for simple barriers.)
From: Andi Kleen <andi@xxxxxxxxxxxxxx>
Date: Thu, 4 Dec 2008 18:48:38 +0100
Cc: Andi Kleen <andi@xxxxxxxxxxxxxx>, linux-kernel@xxxxxxxxxxxxxxx, xfs@xxxxxxxxxxx, Alasdair G Kergon <agk@xxxxxxxxxx>, Andi Kleen <andi-suse@xxxxxxxxxxxxxx>, Milan Broz <mbroz@xxxxxxxxxx>
In-reply-to: <Pine.LNX.4.64.0812041139200.2434@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
References: <Pine.LNX.4.64.0812040009340.15169@xxxxxxxxxxxxxxxxxxxxxxxxxxx> <20081204100050.GN6703@xxxxxxxxxxxxxxxxxx> <Pine.LNX.4.64.0812040836480.6118@xxxxxxxxxxxxxxxxxxxxxxxxxxx> <20081204142015.GQ6703@xxxxxxxxxxxxxxxxxx> <Pine.LNX.4.64.0812040913510.6118@xxxxxxxxxxxxxxxxxxxxxxxxxxx> <20081204145810.GR6703@xxxxxxxxxxxxxxxxxx> <Pine.LNX.4.64.0812041139200.2434@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
User-agent: Mutt/
On Thu, Dec 04, 2008 at 11:45:44AM -0500, Mikulas Patocka wrote:
> > No there is nothing unordered. The file system path typically looks like
> > 
> > commit of a transaction
> >     if (i have never seen a barrier failing) 
> >             write block with barrier
> >             if (EOPNOTSUPP) {
> >                     record failure
> >                     submit synchronously
> >             }
> >     } else
> >             submit synchronously
> > 
> If you view this as a "right" way of using barriers, then you can drop 

It's the way the file systems do it. If you don't believe me feel
free to read the code for yourself.

> barrier support at all and replace this code sequence with:
>  flush disk cache
>  submit write synchronously
>  flush disk cache
> --- because synchronous barriers bring you no performance advantage over 
> the above sequence.

Remember this is done by a commit thread in a journaling file system. 
Commits are ordered so the thread cannot really order out of order 
anyways. And yes the barriers are essentially a way to flush the cache
regularly for selected commits. The alternative (if you
want to guarantee transaction order) would be to disable
the write cache completely and do it synchronous on each IO.

> > So if a pvmove barrier fails it will just submit synchronously.
> > 
> > The write block with barrier bit varies, jbd/gfs2 do it synchronously
> > too and xfs does it asynchronously (with io done callbacks), but
> And how does xfs preserve write ordering, if the barrier asynchronously 
> fails with -EOPNOTSUPP and there are other writes submitted after the 
> barrier?

>From the high level journaling perspective they are not asynchronous
I think. Just the low level xfs_buf interface happens to use the asynchronous
callbacks instead of calling into the block layer directly like jbd et.al.


<Prev in Thread] Current Thread [Next in Thread>