linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/4] block: dont clear REQ_HIPRI for bio-based drivers
@ 2021-03-02 19:05 Mikulas Patocka
  2021-03-03  2:21 ` [dm-devel] " JeffleXu
  0 siblings, 1 reply; 3+ messages in thread
From: Mikulas Patocka @ 2021-03-02 19:05 UTC (permalink / raw)
  To: JeffleXu, Mike Snitzer, Heinz Mauelshagen, axboe, caspar,
	io-uring, linux-block, joseph.qi, dm-devel, hch
  Cc: Mikulas Patocka

[-- Attachment #1: block-allow-bio-hipri.patch --]
[-- Type: text/plain, Size: 759 bytes --]

Don't clear REQ_HIPRI for bio-based drivers. Device mapper will need to
see this flag in order to support polling.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>

---
 block/blk-core.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6/block/blk-core.c
===================================================================
--- linux-2.6.orig/block/blk-core.c	2021-03-02 10:43:28.000000000 +0100
+++ linux-2.6/block/blk-core.c	2021-03-02 10:53:50.000000000 +0100
@@ -836,7 +836,7 @@ static noinline_for_stack bool submit_bi
 		}
 	}
 
-	if (!test_bit(QUEUE_FLAG_POLL, &q->queue_flags))
+	if (!test_bit(QUEUE_FLAG_POLL, &q->queue_flags) && !bdev->bd_disk->fops->submit_bio)
 		bio->bi_opf &= ~REQ_HIPRI;
 
 	switch (bio_op(bio)) {


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dm-devel] [PATCH 2/4] block: dont clear REQ_HIPRI for bio-based drivers
  2021-03-02 19:05 [PATCH 2/4] block: dont clear REQ_HIPRI for bio-based drivers Mikulas Patocka
@ 2021-03-03  2:21 ` JeffleXu
  2021-03-03 10:05   ` Mikulas Patocka
  0 siblings, 1 reply; 3+ messages in thread
From: JeffleXu @ 2021-03-03  2:21 UTC (permalink / raw)
  To: Mikulas Patocka, Mike Snitzer, Heinz Mauelshagen, axboe, caspar,
	io-uring, linux-block, joseph.qi, dm-devel, hch



On 3/3/21 3:05 AM, Mikulas Patocka wrote:
> Don't clear REQ_HIPRI for bio-based drivers. Device mapper will need to
> see this flag in order to support polling.
> 
> Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
> 
> ---
>  block/blk-core.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Index: linux-2.6/block/blk-core.c
> ===================================================================
> --- linux-2.6.orig/block/blk-core.c	2021-03-02 10:43:28.000000000 +0100
> +++ linux-2.6/block/blk-core.c	2021-03-02 10:53:50.000000000 +0100

I notice that the diff header indicates that the code base is from
linux-2.6. Or it's just the name of your directory, while the code base
is for the latest upstream 5.12?


> @@ -836,7 +836,7 @@ static noinline_for_stack bool submit_bi
>  		}
>  	}
>  
> -	if (!test_bit(QUEUE_FLAG_POLL, &q->queue_flags))
> +	if (!test_bit(QUEUE_FLAG_POLL, &q->queue_flags) && !bdev->bd_disk->fops->submit_bio)
>  		bio->bi_opf &= ~REQ_HIPRI;
>  
>  	switch (bio_op(bio)) {
> 
> --

What if dm device is built upon mq devices that are not capable of
polling, i.e., mq devices without QUEUE_FLAG_POLL set? Then this dm
device shall not support polling.


-- 
Thanks,
Jeffle

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dm-devel] [PATCH 2/4] block: dont clear REQ_HIPRI for bio-based drivers
  2021-03-03  2:21 ` [dm-devel] " JeffleXu
@ 2021-03-03 10:05   ` Mikulas Patocka
  0 siblings, 0 replies; 3+ messages in thread
From: Mikulas Patocka @ 2021-03-03 10:05 UTC (permalink / raw)
  To: JeffleXu
  Cc: Mike Snitzer, Heinz Mauelshagen, axboe, caspar, io-uring,
	linux-block, joseph.qi, dm-devel, hch



On Wed, 3 Mar 2021, JeffleXu wrote:

> 
> 
> On 3/3/21 3:05 AM, Mikulas Patocka wrote:
> > Don't clear REQ_HIPRI for bio-based drivers. Device mapper will need to
> > see this flag in order to support polling.
> > 
> > Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
> > 
> > ---
> >  block/blk-core.c |    2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > Index: linux-2.6/block/blk-core.c
> > ===================================================================
> > --- linux-2.6.orig/block/blk-core.c	2021-03-02 10:43:28.000000000 +0100
> > +++ linux-2.6/block/blk-core.c	2021-03-02 10:53:50.000000000 +0100
> 
> I notice that the diff header indicates that the code base is from
> linux-2.6. Or it's just the name of your directory, while the code base
> is for the latest upstream 5.12?

It's just the name of the git repository. The patch is against 5.12-rc1.

> 
> > @@ -836,7 +836,7 @@ static noinline_for_stack bool submit_bi
> >  		}
> >  	}
> >  
> > -	if (!test_bit(QUEUE_FLAG_POLL, &q->queue_flags))
> > +	if (!test_bit(QUEUE_FLAG_POLL, &q->queue_flags) && !bdev->bd_disk->fops->submit_bio)
> >  		bio->bi_opf &= ~REQ_HIPRI;
> >  
> >  	switch (bio_op(bio)) {
> > 
> > --
> 
> What if dm device is built upon mq devices that are not capable of
> polling, i.e., mq devices without QUEUE_FLAG_POLL set? Then this dm
> device shall not support polling.

We will check if the underlying queue has QUEUE_FLAG_POLL in __map_bio - 
see this piece of code:

        case DM_MAPIO_REMAPPED:
                /* the bio has been remapped so dispatch it */
                trace_block_bio_remap(clone, bio_dev(io->orig_bio), sector);
                if (clone->bi_opf & REQ_HIPRI &&
                    test_bit(QUEUE_FLAG_POLL, &clone->bi_bdev->bd_disk->queue->queue_flags)) {
                        ci->poll_queue = clone->bi_bdev->bd_disk->queue;
                        ci->poll_cookie = submit_bio_noacct_mq_direct(clone);
                } else {
                        ci->poll_cookie = BLK_QC_T_NONE;
                        submit_bio_noacct(clone);
                }
                break;

Mikulas


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-03-03 16:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-02 19:05 [PATCH 2/4] block: dont clear REQ_HIPRI for bio-based drivers Mikulas Patocka
2021-03-03  2:21 ` [dm-devel] " JeffleXu
2021-03-03 10:05   ` Mikulas Patocka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).