linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* blk-mq: for sync case, whether it is mq or sq make_request instances, we should send the request directly
@ 2018-05-16  2:54 胡海
  0 siblings, 0 replies; 7+ messages in thread
From: 胡海 @ 2018-05-16  2:54 UTC (permalink / raw)
  To: axboe; +Cc: linux-block, hch

[-- Attachment #1: Type: text/plain, Size: 1080 bytes --]

Author: huhai <huhai@kylinos.cn>
Date:   Wed May 16 10:34:22 2018 +0800

    blk-mq: for sync case, whether it is mq or sq make_request instances, we should send the request directly
    
    For sq make_request instances, we should issue sync request directly too, 
    otherwise it will break down the semantics of sync request, 
    the current code logic is to send synchronous requests asynchronously.
    
    Signed-off-by: huhai <huhai@kylinos.cn>

diff --git a/block/blk-mq.c b/block/blk-mq.c
index 5629f18..fcf2f16 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -1771,7 +1771,7 @@ static blk_qc_t blk_mq_make_request(struct request_queue *q, struct bio *bio)
                        blk_mq_try_issue_directly(data.hctx, same_queue_rq,
                                        &cookie);
                }
-       } else if (q->nr_hw_queues > 1 && is_sync) {
+       } else if (is_sync) {
                blk_mq_put_ctx(data.ctx);
                blk_mq_bio_to_request(rq, bio);
                blk_mq_try_issue_directly(data.hctx, rq, &cookie);

[-- Attachment #2: Type: text/html, Size: 1922 bytes --]

^ permalink raw reply related	[flat|nested] 7+ messages in thread
* blk-mq: for sync case, whether it is mq or sq make_request instances, we should send the request directly
@ 2018-05-16  3:43 胡海
  0 siblings, 0 replies; 7+ messages in thread
From: 胡海 @ 2018-05-16  3:43 UTC (permalink / raw)
  To: axboe; +Cc: linux-block, hch

QXV0aG9yOiBodWhhaSA8aHVoYWlAa3lsaW5vcy5jbj4NCkRhdGU6ICAgV2VkIE1heSAxNiAx
MDozNDoyMiAyMDE4ICswODAwDQoNCiAgICBibGstbXE6IGZvciBzeW5jIGNhc2UsIHdoZXRo
ZXIgaXQgaXMgbXEgb3Igc3EgbWFrZV9yZXF1ZXN0IGluc3Rhb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eChkYXRhLmN0eCk7DQogICAgICAg
ICAgICAgICAgYmxrX21xX2Jpb190b19yZXF1ZXN0KHJxLCBiaW8pOw0KICAgICAgICAgICAg
ICAgIGJsa19tcV90cnlfaXNzdWVfZGlyZWN0bHkoZGF0YS5oY3R4LCBycSwgJmNvb2tpZSk7

^ permalink raw reply	[flat|nested] 7+ messages in thread
* blk-mq: for sync case, whether it is mq or sq make_request instances, we should send the request directly
@ 2018-05-16  3:42 胡海
  2018-05-16 14:15 ` Jens Axboe
  0 siblings, 1 reply; 7+ messages in thread
From: 胡海 @ 2018-05-16  3:42 UTC (permalink / raw)
  To: linux-block

QXV0aG9yOiBodWhhaSA8aHVoYWlAa3lsaW5vcy5jbj4NCkRhdGU6ICAgV2VkIE1heSAxNiAx
MDozNDoyMiAyMDE4ICswODAwDQoNCiAgICBibGstbXE6IGZvciBzeW5jIGNhc2UsIHdoZXRo
ZXIgaXQgaXMgbXEgb3Igc3EgbWFrZV9yZXF1ZXN0IGluc3RhbmNlcywgd2Ugc2hvdWxkIHNl
bmQgdGhlIHJlcXVlc3QgZGlyZWN0bHkNCiAgICANCiAgICBGb3Igc3EgbWFrZV9yZXF1ZXN0
IGluc3RhbmNlcywgd2Ugc2hvdWxkIGlzc3VlIHN5bmMgcmVxdWVzdCBkaXJlY3RseSB0b28s
IA0KICAgIG90aGVyd2lzZSBpdCB3aWxsIGJyZWFrIGRvd24gdGhlIHNlbWFudGljcyBvZiBz
eW5jIHJlcXVlc3QsIA0KICAgIHRoZSBjdXJyZW50IGNvZGUgbG9naWMgaXMgdG8gc2VuZCBz
eW5jaHJvbm91cyByZXF1ZXN0cyBhc3luY2hyb25vdXNseS4NCiAgICANCiAgICBTaWduZWQt
b2ZmLWJ5OiBodWhhaSA8aHVoYWlAa3lsaW5vcy5jbj4NCg0KZGlmZiAtLWdpdCBhL2Jsb2Nr
L2Jsay1tcS5jIGIvYmxvY2svYmxrLW1xLmMNCmluZGV4IDU2MjlmMTguLmZjZjJmMTYgMTAw
NjQ0DQotLS0gYS9ibG9jay9ibGstbXEuYw0KKysrIGIvYmxvY2svYmxrLW1xLmMNCkBAIC0x
NzcxLDcgKzE3NzEsNyBAQCBzdGF0aWMgYmxrX3FjX3QgYmxrX21xX21ha2VfcmVxdWVzdChz
dHJ1Y3QgcmVxdWVzdF9xdWV1ZSAqcSwgc3RydWN0IGJpbyAqYmlvKQ0KICAgICAgICAgICAg
ICAgICAgICAgICAgYmxrX21xX3RyeV9pc3N1ZV9kaXJlY3RseShkYXRhLmhjdHgsIHNhbWVf
cXVldWVfcnEsDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmNv
b2tpZSk7DQogICAgICAgICAgICAgICAgfQ0KLSAgICAgICB9IGVsc2UgaWYgKHEtPm5yX2h3
X3F1ZXVlcyA+IDEgJiYgaXNfc3luYykgew0KKyAgICAgICB9IGVsc2UgaWYgKGlzX3N5bmMp
IHsNCiAgICAgICAgICAgICAgICBibGtfbXFfcHV0X2N0eChkYXRhLmN0eCk7DQogICAgICAg
ICAgICAgICAgYmxrX21xX2Jpb190b19yZXF1ZXN0KHJxLCBiaW8pOw0KICAgICAgICAgICAg
ICAgIGJsa19tcV90cnlfaXNzdWVfZGlyZWN0bHkoZGF0YS5oY3R4LCBycSwgJmNvb2tpZSk7

^ permalink raw reply	[flat|nested] 7+ messages in thread
* blk-mq: for sync case, whether it is mq or sq make_request instances, we should send the request directly
@ 2018-05-16  3:24 胡海
  0 siblings, 0 replies; 7+ messages in thread
From: 胡海 @ 2018-05-16  3:24 UTC (permalink / raw)
  To: axboe; +Cc: linux-block

[-- Attachment #1: Type: text/plain, Size: 1048 bytes --]

Author: huhai <huhai@kylinos.cn>
Date:   Wed May 16 10:34:22 2018 +0800

    blk-mq: for sync case, whether it is mq or sq make_request instances,
we should send the request directly

    For sq make_request instances, we should issue sync request directly
too,
    otherwise it will break down the semantics of sync request,
    the current code logic is to send synchronous requests asynchronously.

    Signed-off-by: huhai <huhai@kylinos.cn>

diff --git a/block/blk-mq.c b/block/blk-mq.c
index 5629f18..fcf2f16 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -1771,7 +1771,7 @@ static blk_qc_t blk_mq_make_request(struct
request_queue *q, struct bio *bio)
                        blk_mq_try_issue_directly(data.hctx, same_queue_rq,
                                        &cookie);
                }
-       } else if (q->nr_hw_queues > 1 && is_sync) {
+       } else if (is_sync) {
                blk_mq_put_ctx(data.ctx);
                blk_mq_bio_to_request(rq, bio);
                blk_mq_try_issue_directly(data.hctx, rq, &cookie);

[-- Attachment #2: Type: text/html, Size: 1340 bytes --]

^ permalink raw reply related	[flat|nested] 7+ messages in thread
* blk-mq: for sync case, whether it is mq or sq make_request instances, we should send the request directly
@ 2018-05-16  2:56 胡海
  0 siblings, 0 replies; 7+ messages in thread
From: 胡海 @ 2018-05-16  2:56 UTC (permalink / raw)
  To: axboe; +Cc: linux-block

[-- Attachment #1: Type: text/plain, Size: 1080 bytes --]

Author: huhai <huhai@kylinos.cn>
Date:   Wed May 16 10:34:22 2018 +0800

    blk-mq: for sync case, whether it is mq or sq make_request instances, we should send the request directly
    
    For sq make_request instances, we should issue sync request directly too, 
    otherwise it will break down the semantics of sync request, 
    the current code logic is to send synchronous requests asynchronously.
    
    Signed-off-by: huhai <huhai@kylinos.cn>

diff --git a/block/blk-mq.c b/block/blk-mq.c
index 5629f18..fcf2f16 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -1771,7 +1771,7 @@ static blk_qc_t blk_mq_make_request(struct request_queue *q, struct bio *bio)
                        blk_mq_try_issue_directly(data.hctx, same_queue_rq,
                                        &cookie);
                }
-       } else if (q->nr_hw_queues > 1 && is_sync) {
+       } else if (is_sync) {
                blk_mq_put_ctx(data.ctx);
                blk_mq_bio_to_request(rq, bio);
                blk_mq_try_issue_directly(data.hctx, rq, &cookie);

[-- Attachment #2: Type: text/html, Size: 1882 bytes --]

^ permalink raw reply related	[flat|nested] 7+ messages in thread
* blk-mq: for sync case, whether it is mq or sq make_request instances, we should send the request directly
@ 2018-05-16  2:44 胡海
  0 siblings, 0 replies; 7+ messages in thread
From: 胡海 @ 2018-05-16  2:44 UTC (permalink / raw)
  To: axboe; +Cc: linux-block, hch

[-- Attachment #1: Type: text/plain, Size: 1080 bytes --]

Author: huhai <huhai@kylinos.cn>
Date:   Wed May 16 10:34:22 2018 +0800

    blk-mq: for sync case, whether it is mq or sq make_request instances, we should send the request directly
    
    For sq make_request instances, we should issue sync request directly too, 
    otherwise it will break down the semantics of sync request, 
    the current code logic is to send synchronous requests asynchronously.
    
    Signed-off-by: huhai <huhai@kylinos.cn>

diff --git a/block/blk-mq.c b/block/blk-mq.c
index 5629f18..fcf2f16 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -1771,7 +1771,7 @@ static blk_qc_t blk_mq_make_request(struct request_queue *q, struct bio *bio)
                        blk_mq_try_issue_directly(data.hctx, same_queue_rq,
                                        &cookie);
                }
-       } else if (q->nr_hw_queues > 1 && is_sync) {
+       } else if (is_sync) {
                blk_mq_put_ctx(data.ctx);
                blk_mq_bio_to_request(rq, bio);
                blk_mq_try_issue_directly(data.hctx, rq, &cookie);

[-- Attachment #2: Type: text/html, Size: 2002 bytes --]

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

end of thread, other threads:[~2018-05-16 14:15 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-16  2:54 blk-mq: for sync case, whether it is mq or sq make_request instances, we should send the request directly 胡海
  -- strict thread matches above, loose matches on Subject: below --
2018-05-16  3:43 胡海
2018-05-16  3:42 胡海
2018-05-16 14:15 ` Jens Axboe
2018-05-16  3:24 胡海
2018-05-16  2:56 胡海
2018-05-16  2:44 胡海

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).