All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <jens.axboe@oracle.com>
To: Mikulas Patocka <mpatocka@redhat.com>
Cc: device-mapper development <dm-devel@redhat.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	"MASON, CHRISTOPHER" <CHRIS.MASON@oracle.com>,
	Andi Kleen <ak@suse.de>
Subject: Re: Barriers still not passing on simple dm devices...
Date: Tue, 24 Mar 2009 15:05:24 +0100	[thread overview]
Message-ID: <20090324140524.GV27476@kernel.dk> (raw)
In-Reply-To: <Pine.LNX.4.64.0903241000010.29968@hs20-bc2-1.build.redhat.com>

On Tue, Mar 24 2009, Mikulas Patocka wrote:
> 
> 
> On Mon, 23 Mar 2009, Eric Sandeen wrote:
> 
> > I've noticed that on 2.6.29-rcX, with Andi's patch
> > (ab4c1424882be9cd70b89abf2b484add355712fa, dm: support barriers on
> > simple devices) barriers are still getting rejected on these simple devices.
> > 
> > The problem is in __generic_make_request():
> > 
> >                 if (bio_barrier(bio) && bio_has_data(bio) &&
> >                     (q->next_ordered == QUEUE_ORDERED_NONE)) {
> >                         err = -EOPNOTSUPP;
> >                         goto end_io;
> >                 }
> > 
> > and dm isn't flagging its queue as supporting ordered writes, so it's
> > rejected here.
> > 
> > Doing something like this:
> > 
> > + if (t->barriers_supported)
> > +         blk_queue_ordered(q, QUEUE_ORDERED_DRAIN, NULL);
> > 
> > somewhere in dm (I stuck it in dm_table_set_restrictions() - almost
> > certainly the wrong thing to do) did get my dm-linear device to mount
> > with xfs, w/o xfs complaining that its mount-time barrier tests failed.
> > 
> > So what's the right way around this?  What should dm (or md for that
> > matter) advertise on their queues about ordered-ness?  Should there be
> > some sort of "QUEUE_ORDERED_PASSTHROUGH" or something to say "this level
> > doesn't care, ask the next level" or somesuch?  Or should it inherit the
> > flag from the next level down?  Ideas?
> > 
> > Thanks,
> > -Eric
> > 
> > --
> > dm-devel mailing list
> > dm-devel@redhat.com
> > https://www.redhat.com/mailman/listinfo/dm-devel
> 
> Hi
> 
> This is misdesign in generic bio layer and it should be fixed there. I 
> think it is blocking barrier support in md-raid1 too. Jens, pls apply the 
> attached patch.
> 
> Mikulas
> 
> ----
> 
> Move test for not-supported barriers to __make_request.
> 
> This test prevents barriers from being dispatched to device mapper
> and md.
> 
> This test is sensible only for drivers that use requests (such as disk
> drivers), not for drivers that use bios.
> 
> It is better to fix it in generic code than to make workaround for it
> in device mapper and md.

So you audited any ->make_request_fn style driver and made sure they
rejected barriers?

> 
> Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
> 
> ---
>  block/blk-core.c |   11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
> 
> Index: linux-2.6.29-rc6-devel/block/blk-core.c
> ===================================================================
> --- linux-2.6.29-rc6-devel.orig/block/blk-core.c	2009-02-23 18:43:37.000000000 +0100
> +++ linux-2.6.29-rc6-devel/block/blk-core.c	2009-02-23 18:44:27.000000000 +0100
> @@ -1145,6 +1145,12 @@ static int __make_request(struct request
>  	const int unplug = bio_unplug(bio);
>  	int rw_flags;
>  
> +	if (bio_barrier(bio) && bio_has_data(bio) &&
> +	    (q->next_ordered == QUEUE_ORDERED_NONE)) {
> +		bio_endio(bio, -EOPNOTSUPP);
> +		return 0;
> +	}
> +
>  	nr_sectors = bio_sectors(bio);
>  
>  	/*
> @@ -1450,11 +1456,6 @@ static inline void __generic_make_reques
>  			err = -EOPNOTSUPP;
>  			goto end_io;
>  		}
> -		if (bio_barrier(bio) && bio_has_data(bio) &&
> -		    (q->next_ordered == QUEUE_ORDERED_NONE)) {
> -			err = -EOPNOTSUPP;
> -			goto end_io;
> -		}
>  
>  		ret = q->make_request_fn(q, bio);
>  	} while (ret);
> > 

-- 
Jens Axboe

WARNING: multiple messages have this Message-ID (diff)
From: Jens Axboe <jens.axboe@oracle.com>
To: Mikulas Patocka <mpatocka@redhat.com>
Cc: device-mapper development <dm-devel@redhat.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Andi Kleen <ak@suse.de>,
	"MASON, CHRISTOPHER" <CHRIS.MASON@oracle.com>
Subject: Re: [dm-devel] Barriers still not passing on simple dm devices...
Date: Tue, 24 Mar 2009 15:05:24 +0100	[thread overview]
Message-ID: <20090324140524.GV27476@kernel.dk> (raw)
In-Reply-To: <Pine.LNX.4.64.0903241000010.29968@hs20-bc2-1.build.redhat.com>

On Tue, Mar 24 2009, Mikulas Patocka wrote:
> 
> 
> On Mon, 23 Mar 2009, Eric Sandeen wrote:
> 
> > I've noticed that on 2.6.29-rcX, with Andi's patch
> > (ab4c1424882be9cd70b89abf2b484add355712fa, dm: support barriers on
> > simple devices) barriers are still getting rejected on these simple devices.
> > 
> > The problem is in __generic_make_request():
> > 
> >                 if (bio_barrier(bio) && bio_has_data(bio) &&
> >                     (q->next_ordered == QUEUE_ORDERED_NONE)) {
> >                         err = -EOPNOTSUPP;
> >                         goto end_io;
> >                 }
> > 
> > and dm isn't flagging its queue as supporting ordered writes, so it's
> > rejected here.
> > 
> > Doing something like this:
> > 
> > + if (t->barriers_supported)
> > +         blk_queue_ordered(q, QUEUE_ORDERED_DRAIN, NULL);
> > 
> > somewhere in dm (I stuck it in dm_table_set_restrictions() - almost
> > certainly the wrong thing to do) did get my dm-linear device to mount
> > with xfs, w/o xfs complaining that its mount-time barrier tests failed.
> > 
> > So what's the right way around this?  What should dm (or md for that
> > matter) advertise on their queues about ordered-ness?  Should there be
> > some sort of "QUEUE_ORDERED_PASSTHROUGH" or something to say "this level
> > doesn't care, ask the next level" or somesuch?  Or should it inherit the
> > flag from the next level down?  Ideas?
> > 
> > Thanks,
> > -Eric
> > 
> > --
> > dm-devel mailing list
> > dm-devel@redhat.com
> > https://www.redhat.com/mailman/listinfo/dm-devel
> 
> Hi
> 
> This is misdesign in generic bio layer and it should be fixed there. I 
> think it is blocking barrier support in md-raid1 too. Jens, pls apply the 
> attached patch.
> 
> Mikulas
> 
> ----
> 
> Move test for not-supported barriers to __make_request.
> 
> This test prevents barriers from being dispatched to device mapper
> and md.
> 
> This test is sensible only for drivers that use requests (such as disk
> drivers), not for drivers that use bios.
> 
> It is better to fix it in generic code than to make workaround for it
> in device mapper and md.

So you audited any ->make_request_fn style driver and made sure they
rejected barriers?

> 
> Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
> 
> ---
>  block/blk-core.c |   11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
> 
> Index: linux-2.6.29-rc6-devel/block/blk-core.c
> ===================================================================
> --- linux-2.6.29-rc6-devel.orig/block/blk-core.c	2009-02-23 18:43:37.000000000 +0100
> +++ linux-2.6.29-rc6-devel/block/blk-core.c	2009-02-23 18:44:27.000000000 +0100
> @@ -1145,6 +1145,12 @@ static int __make_request(struct request
>  	const int unplug = bio_unplug(bio);
>  	int rw_flags;
>  
> +	if (bio_barrier(bio) && bio_has_data(bio) &&
> +	    (q->next_ordered == QUEUE_ORDERED_NONE)) {
> +		bio_endio(bio, -EOPNOTSUPP);
> +		return 0;
> +	}
> +
>  	nr_sectors = bio_sectors(bio);
>  
>  	/*
> @@ -1450,11 +1456,6 @@ static inline void __generic_make_reques
>  			err = -EOPNOTSUPP;
>  			goto end_io;
>  		}
> -		if (bio_barrier(bio) && bio_has_data(bio) &&
> -		    (q->next_ordered == QUEUE_ORDERED_NONE)) {
> -			err = -EOPNOTSUPP;
> -			goto end_io;
> -		}
>  
>  		ret = q->make_request_fn(q, bio);
>  	} while (ret);
> > 

-- 
Jens Axboe


  reply	other threads:[~2009-03-24 14:05 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-23 19:04 Barriers still not passing on simple dm devices Eric Sandeen
2009-03-23 19:10 ` Eric Sandeen
2009-03-23 19:10   ` Eric Sandeen
2009-03-24 14:02 ` Mikulas Patocka
2009-03-24 14:02   ` [dm-devel] " Mikulas Patocka
2009-03-24 14:05   ` Jens Axboe [this message]
2009-03-24 14:05     ` Jens Axboe
2009-03-24 14:26     ` Mikulas Patocka
2009-03-24 14:26       ` [dm-devel] " Mikulas Patocka
2009-03-24 14:30       ` Jens Axboe
2009-03-24 14:30         ` [dm-devel] " Jens Axboe
2009-03-24 14:45         ` Mikulas Patocka
2009-03-24 14:45           ` [dm-devel] " Mikulas Patocka
2009-03-24 15:05           ` Jens Axboe
2009-03-24 15:05             ` [dm-devel] " Jens Axboe
2009-03-25 15:15             ` Mikulas Patocka
2009-03-25 15:15               ` [dm-devel] " Mikulas Patocka
2009-03-25 15:27               ` Jens Axboe
2009-03-25 22:39                 ` Mikulas Patocka
2009-03-25 22:39                   ` [dm-devel] " Mikulas Patocka
2009-03-26  8:42                   ` Jens Axboe
2009-03-26  8:42                     ` [dm-devel] " Jens Axboe
2009-03-31  3:39                     ` Mikulas Patocka
2009-03-31  3:39                       ` [dm-devel] " Mikulas Patocka
2009-03-31 10:49                       ` Jens Axboe
2009-03-31 10:49                         ` [dm-devel] " Jens Axboe
2009-04-02 23:40                         ` Mikulas Patocka
2009-04-02 23:40                           ` [dm-devel] " Mikulas Patocka
2009-04-03  8:11                           ` Jens Axboe
2009-04-03  8:11                             ` [dm-devel] " Jens Axboe
2009-04-04 15:20                             ` Ric Wheeler
2009-04-05  1:28                               ` Theodore Tso
2009-04-05  1:28                                 ` [dm-devel] " Theodore Tso
2009-04-05 11:54                                 ` Ric Wheeler
2009-04-06  1:14                                   ` Lee Revell
2009-04-06  1:14                                     ` [dm-devel] " Lee Revell
2009-04-06  1:24                                     ` Ric Wheeler
2009-04-08 12:44                                     ` Mikulas Patocka
2009-04-08 12:44                                       ` [dm-devel] " Mikulas Patocka
2009-04-08 15:16                                       ` Henrique de Moraes Holschuh
2009-04-09  4:22                                     ` Eric Sandeen
2009-04-09  4:22                                       ` [dm-devel] " Eric Sandeen
2009-04-05 11:54                                 ` Ric Wheeler
2009-04-08 12:36                                 ` Mikulas Patocka
2009-04-08 12:36                                   ` [dm-devel] " Mikulas Patocka
2009-04-08 12:54                               ` Mikulas Patocka
2009-04-08 12:54                                 ` [dm-devel] " Mikulas Patocka
2009-04-09 10:48                                 ` Ric Wheeler
2009-04-09 10:48                                   ` [dm-devel] " Ric Wheeler
2009-04-08 13:37                             ` Mikulas Patocka
2009-04-08 13:37                               ` [dm-devel] " Mikulas Patocka
2009-04-08 14:06                               ` Jens Axboe
2009-04-08 14:06                                 ` [dm-devel] " Jens Axboe
2009-04-08 23:44                               ` Dave Chinner
2009-04-08 23:44                                 ` [dm-devel] " Dave Chinner
2009-04-09  1:27                               ` Chris Mason
2009-04-09 10:28                                 ` Alasdair G Kergon
2009-04-09 10:28                                   ` [dm-devel] " Alasdair G Kergon
2009-03-26 12:55                   ` Chris Mason
     [not found] <ciXHh-39c-37@gated-at.bofh.it>
2009-03-23 21:52 ` Bodo Eggert
2009-03-23 21:52   ` Bodo Eggert
     [not found] ` <cjfuL-6vJ-43@gated-at.bofh.it>
     [not found]   ` <cjfEl-6J2-45@gated-at.bofh.it>
     [not found]     ` <cjfNX-6Wh-27@gated-at.bofh.it>
2009-03-26 13:05       ` Bodo Eggert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090324140524.GV27476@kernel.dk \
    --to=jens.axboe@oracle.com \
    --cc=CHRIS.MASON@oracle.com \
    --cc=ak@suse.de \
    --cc=dm-devel@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpatocka@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.