* [PATCH v2] block: fix deadline elevator drain for zoned block devices
@ 2018-09-26 7:30 Damien Le Moal
2018-09-26 14:30 ` Jens Axboe
2018-09-26 15:38 ` Bart Van Assche
0 siblings, 2 replies; 3+ messages in thread
From: Damien Le Moal @ 2018-09-26 7:30 UTC (permalink / raw)
To: linux-block, Jens Axboe
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>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
---
Changes from v1:
* Fixed typo in commit message
block/elevator.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/block/elevator.c b/block/elevator.c
index 6a06b5d040e5..8cd81fd6339a 100644
--- a/block/elevator.c
+++ b/block/elevator.c
@@ -609,7 +609,7 @@ void elv_drain_elevator(struct request_queue *q)
while (e->type->ops.sq.elevator_dispatch_fn(q, 1))
;
- if (q->nr_sorted && printed++ < 10) {
+ if (q->nr_sorted && printed++ < 10 && !blk_queue_is_zoned(q)) {
printk(KERN_ERR "%s: forced dispatching is broken "
"(nr_sorted=%u), please report this\n",
q->elevator->type->elevator_name, q->nr_sorted);
--
2.17.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] block: fix deadline elevator drain for zoned block devices
2018-09-26 7:30 [PATCH v2] block: fix deadline elevator drain for zoned block devices Damien Le Moal
@ 2018-09-26 14:30 ` Jens Axboe
2018-09-26 15:38 ` Bart Van Assche
1 sibling, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2018-09-26 14:30 UTC (permalink / raw)
To: Damien Le Moal, linux-block
On 9/26/18 1:30 AM, Damien Le Moal wrote:
> 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.
Applied for 4.19, thanks Damien.
--
Jens Axboe
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] block: fix deadline elevator drain for zoned block devices
2018-09-26 7:30 [PATCH v2] block: fix deadline elevator drain for zoned block devices Damien Le Moal
2018-09-26 14:30 ` Jens Axboe
@ 2018-09-26 15:38 ` Bart Van Assche
1 sibling, 0 replies; 3+ messages in thread
From: Bart Van Assche @ 2018-09-26 15:38 UTC (permalink / raw)
To: Damien Le Moal, linux-block, Jens Axboe
On Wed, 2018-09-26 at 16:30 +0900, Damien Le Moal wrote:
> diff --git a/block/elevator.c b/block/elevator.c
> index 6a06b5d040e5..8cd81fd6339a 100644
> --- a/block/elevator.c
> +++ b/block/elevator.c
> @@ -609,7 +609,7 @@ void elv_drain_elevator(struct request_queue *q)
>
> while (e->type->ops.sq.elevator_dispatch_fn(q, 1))
> ;
> - if (q->nr_sorted && printed++ < 10) {
> + if (q->nr_sorted && printed++ < 10 && !blk_queue_is_zoned(q)) {
> printk(KERN_ERR "%s: forced dispatching is broken "
> "(nr_sorted=%u), please report this\n",
> q->elevator->type->elevator_name, q->nr_sorted);
It seems wrong to me to perform the blk_queue_is_zoned() check after having
incremented the "printed" variable. Shouldn't that check be performed before
incrementing the "printed" variable to avoid that "printed" gets incremented
if we know that we are not going to report the error message?
Thanks,
Bart.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-09-26 15:38 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-26 7:30 [PATCH v2] block: fix deadline elevator drain for zoned block devices Damien Le Moal
2018-09-26 14:30 ` Jens Axboe
2018-09-26 15:38 ` Bart Van Assche
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).