Skip to contentSkip to conversation

block: dont clear REQ_HIPRI for bio-based drivers

PATCH In review Mikulas Patocka 2 participants 3 messages Mar 2, 2021 – Mar 3, 2021

Subsystems (3)
lore
Share & tools
lore

Mikulas Patocka

author maintainer
#0 lore raw

PATCH 2/4 block: dont clear REQ_HIPRI for bio-based drivers

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

---
 block/blk-core.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
block/blk-core.c +1 -1
Index: linux-2.6/block/blk-core.c
===================================================================
@@ -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)) {

--
dm-devel mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/dm-devel

#1 lore raw

block/blk-core.c

Quoted 13 lines · Mikulas Patocka

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

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

Index: linux-2.6/block/blk-core.c
===================================================================

block/blk-core.c +0 -0

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?

block/blk-core.c static noinline_for_stack bool submit_bi

Quoted 11 lines
block/blk-core.c +1 -2
@@ -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.

Signature · 2 lines
Thanks,
Jeffle
author maintainer
#2 lore raw
Quoted 12 lines · JeffleXu
Quoted 9 lines · Mikulas Patocka

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

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

block/blk-core.c

Quoted 4 lines

Index: linux-2.6/block/blk-core.c
===================================================================

block/blk-core.c +0 -0

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.

Quoted 9 lines
Quoted 9 lines
block/blk-core.c +1 -1
@@ -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;
 
Quoted 7 lines

block/blk-core.c static noinline_for_stack bool submit_bi

Quoted 3 lines
block/blk-core.c +0 -1
 	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

--
dm-devel mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/dm-devel