Skip to content

Commit 854f31c

Browse files
damien-lemoalaxboe
authored andcommitted
block: fix deadline elevator drain for zoned block devices
When the deadline scheduler is used with a zoned block device, writes to a zone will be dispatched one at a time. This causes the warning message: deadline: forced dispatching is broken (nr_sorted=X), please report this to be displayed when switching to another elevator with the legacy I/O path while write requests to a zone are being retained in the scheduler queue. Prevent this message from being displayed when executing elv_drain_elevator() for a zoned block device. __blk_drain_queue() will loop until all writes are dispatched and completed, resulting in the desired elevator queue drain without extensive modifications to the deadline code itself to handle forced-dispatch calls. Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com> Fixes: 8dc8146 ("deadline-iosched: Introduce zone locking support") Cc: stable@vger.kernel.org Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 530ca2c commit 854f31c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

block/elevator.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,7 @@ void elv_drain_elevator(struct request_queue *q)
609609

610610
while (e->type->ops.sq.elevator_dispatch_fn(q, 1))
611611
;
612-
if (q->nr_sorted && printed++ < 10) {
612+
if (q->nr_sorted && !blk_queue_is_zoned(q) && printed++ < 10 ) {
613613
printk(KERN_ERR "%s: forced dispatching is broken "
614614
"(nr_sorted=%u), please report this\n",
615615
q->elevator->type->elevator_name, q->nr_sorted);

0 commit comments

Comments
 (0)