Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

blk-mq-sched: unify elevators checking for async requests

bfq and mq-deadline consider sync writes as async requests and only
reserve tags for sync reads by async_depth, however, kyber doesn't
consider sync writes as async requests for now.

Consider the case there are lots of dirty pages, and user use fsync to
flush dirty pages. In this case sched_tags can be exhausted by sync writes
and sync reads can stuck waiting for tag. Hence let kyber follow what
mq-deadline and bfq did, and unify async requests checking for all
elevators.

Signed-off-by: Yu Kuai <yukuai@fnnas.com>
Reviewed-by: Nilay Shroff <nilay@linux.ibm.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Yu Kuai and committed by
Jens Axboe
1db61b0a 9fc7900b

+8 -3
+1 -1
block/bfq-iosched.c
··· 697 697 unsigned int limit, act_idx; 698 698 699 699 /* Sync reads have full depth available */ 700 - if (op_is_sync(opf) && !op_is_write(opf)) 700 + if (blk_mq_is_sync_read(opf)) 701 701 limit = data->q->nr_requests; 702 702 else 703 703 limit = bfqd->async_depths[!!bfqd->wr_busy_queues][op_is_sync(opf)];
+5
block/blk-mq-sched.h
··· 137 137 depth); 138 138 } 139 139 140 + static inline bool blk_mq_is_sync_read(blk_opf_t opf) 141 + { 142 + return op_is_sync(opf) && !op_is_write(opf); 143 + } 144 + 140 145 #endif
+1 -1
block/kyber-iosched.c
··· 556 556 * We use the scheduler tags as per-hardware queue queueing tokens. 557 557 * Async requests can be limited at this stage. 558 558 */ 559 - if (!op_is_sync(opf)) { 559 + if (!blk_mq_is_sync_read(opf)) { 560 560 struct kyber_queue_data *kqd = data->q->elevator->elevator_data; 561 561 562 562 data->shallow_depth = kqd->async_depth;
+1 -1
block/mq-deadline.c
··· 495 495 struct deadline_data *dd = data->q->elevator->elevator_data; 496 496 497 497 /* Do not throttle synchronous reads. */ 498 - if (op_is_sync(opf) && !op_is_write(opf)) 498 + if (blk_mq_is_sync_read(opf)) 499 499 return; 500 500 501 501 /*