public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] blk-mq: don't use rw_is_sync() to determine sync request
@ 2014-12-01  0:01 Shaohua Li
  2014-12-01  1:35 ` Jens Axboe
  0 siblings, 1 reply; 6+ messages in thread
From: Shaohua Li @ 2014-12-01  0:01 UTC (permalink / raw)
  To: linux-kernel; +Cc: axboe

Buffer read is counted as sync in rw_is_sync(). If we use it,
blk_sq_make_request() will not do per-process plug any more.

I haven't changed blk_mq_make_request() yet. It makes sense to dispatch
REQ_SYNC request immediately. But for buffer read, it's weird not to do
per-process plug, as buffer read doesn't need low latency.
blk_mq_merge_queue_io() isn't very helpful, as we don't have delay mechanism
there, the queue is immediately flushed, which makes the merge very
superficial.

Signed-off-by: Shaohua Li <shli@fb.com>
---
 block/blk-mq.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/block/blk-mq.c b/block/blk-mq.c
index d5b4643..0ccbfac 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -1106,7 +1106,7 @@ static struct request *blk_mq_map_request(struct request_queue *q,
 	ctx = blk_mq_get_ctx(q);
 	hctx = q->mq_ops->map_queue(q, ctx->cpu);
 
-	if (rw_is_sync(bio->bi_rw))
+	if (bio->bi_rw & REQ_SYNC)
 		rw |= REQ_SYNC;
 
 	trace_block_getrq(q, bio, rw);
@@ -1206,7 +1206,7 @@ static void blk_mq_make_request(struct request_queue *q, struct bio *bio)
  */
 static void blk_sq_make_request(struct request_queue *q, struct bio *bio)
 {
-	const int is_sync = rw_is_sync(bio->bi_rw);
+	const int is_sync = !!(bio->bi_rw & REQ_SYNC);
 	const int is_flush_fua = bio->bi_rw & (REQ_FLUSH | REQ_FUA);
 	unsigned int use_plug, request_count = 0;
 	struct blk_map_ctx data;
-- 
1.8.3.2


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

end of thread, other threads:[~2014-12-03 18:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-01  0:01 [PATCH] blk-mq: don't use rw_is_sync() to determine sync request Shaohua Li
2014-12-01  1:35 ` Jens Axboe
2014-12-01  3:57   ` Shaohua Li
2014-12-01 18:59     ` Shaohua Li
2014-12-02  2:43       ` Jens Axboe
2014-12-03 18:01         ` Shaohua Li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox