2009-08-27 16:54:44

by Jeff Garzik

[permalink] [raw]
Subject: MD/DM and barriers (was Re: [patch] ext2/3: document conditions when reliable operation is possible)

On 08/27/2009 09:10 AM, Ric Wheeler wrote:
> One thing that does need fixing for some MD configurations is to stress
> again that we need to make sure that barrier operations are properly
> supported or users will need to disable the write cache on devices with
> volatile write caches.

Agreed; chime in on Christoph's linux-vfs thread if people have input.

I quickly glanced at MD and DM. Currently, upstream, we see a lot of

if (unlikely(bio_barrier(bio))) {
bio_endio(bio, -EOPNOTSUPP);
return 0;
}

in DM and MD make_request functions.

Only md/raid1 supports barriers at present, it seems. None of the other
MD drivers support barriers.

DM has some barrier code... but the above code was pasted from DM's
make_request function, so I am guessing that DM's barrier stuff is
incomplete and disabled at present.

I've been mentioning this issue for years... glad some people finally
noticed :)

Jeff





2009-08-27 18:09:42

by Alasdair G Kergon

[permalink] [raw]
Subject: Re: MD/DM and barriers (was Re: [patch] ext2/3: document conditions when reliable operation is possible)

On Thu, Aug 27, 2009 at 12:54:05PM -0400, Jeff Garzik wrote:
> DM has some barrier code... but the above code was pasted from DM's
> make_request function, so I am guessing that DM's barrier stuff is
> incomplete and disabled at present.

That code is from the new request-based multipath implementation in 2.6.31
which doesn't yet.

But bio-based dm does support barriers now. (Just missing some patches to
complete the dm-raid1 support that are still under review IIRC.)

Alasdair

2009-09-01 14:01:21

by Pavel Machek

[permalink] [raw]
Subject: Re: MD/DM and barriers (was Re: [patch] ext2/3: document conditions when reliable operation is possible)

On Thu 2009-08-27 12:54:05, Jeff Garzik wrote:
> On 08/27/2009 09:10 AM, Ric Wheeler wrote:
>> One thing that does need fixing for some MD configurations is to stress
>> again that we need to make sure that barrier operations are properly
>> supported or users will need to disable the write cache on devices with
>> volatile write caches.
>
> Agreed; chime in on Christoph's linux-vfs thread if people have input.
>
> I quickly glanced at MD and DM. Currently, upstream, we see a lot of
>
> if (unlikely(bio_barrier(bio))) {
> bio_endio(bio, -EOPNOTSUPP);
> return 0;
> }
>
> in DM and MD make_request functions.
>
> Only md/raid1 supports barriers at present, it seems. None of the other
> MD drivers support barriers.

Not even md/raid0? Ouch :-(.

Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

2009-09-02 16:17:40

by Michael Tokarev

[permalink] [raw]
Subject: Re: MD/DM and barriers (was Re: [patch] ext2/3: document conditions when reliable operation is possible)

Pavel Machek wrote:
> On Thu 2009-08-27 12:54:05, Jeff Garzik wrote:
[]
>> Only md/raid1 supports barriers at present, it seems. None of the other
>> MD drivers support barriers.
>
> Not even md/raid0? Ouch :-(.

Only for raid1 there's no requiriment for inter-drive ordering. Hence
only raid1 supports barriers (and gained that support very recently,
in 1 or 2 kernel releases). For the rest, including raid0 and linear,
inter-drive ordering is necessary to implement barriers. Or md should
have its own queue (flushing) mechanisms.

/mjt