From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Cc: stable@vger.kernel.org
Subject: Re: [PATCH] block: mq-deadline: Fix dd_finish_request() for zoned devices
Date: Thu, 5 Jan 2023 12:49:30 +0100 [thread overview]
Message-ID: <Y7a5SuwQZMB+Q+mr@kroah.com> (raw)
In-Reply-To: <20230105040756.579794-1-damien.lemoal@opensource.wdc.com>
On Thu, Jan 05, 2023 at 01:07:56PM +0900, Damien Le Moal wrote:
> commit 2820e5d0820ac4daedff1272616a53d9c7682fd2 upstream.
>
> dd_finish_request() tests if the per prio fifo_list is not empty to
> determine if request dispatching must be restarted for handling blocked
> write requests to zoned devices with a call to
> blk_mq_sched_mark_restart_hctx(). While simple, this implementation has
> 2 problems:
>
> 1) Only the priority level of the completed request is considered.
> However, writes to a zone may be blocked due to other writes to the
> same zone using a different priority level. While this is unlikely to
> happen in practice, as writing a zone with different IO priorirites
> does not make sense, nothing in the code prevents this from
> happening.
> 2) The use of list_empty() is dangerous as dd_finish_request() does not
> take dd->lock and may run concurrently with the insert and dispatch
> code.
>
> Fix these 2 problems by testing the write fifo list of all priority
> levels using the new helper dd_has_write_work(), and by testing each
> fifo list using list_empty_careful().
>
> Fixes: c807ab520fc3 ("block/mq-deadline: Add I/O priority support")
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
> Link: https://lore.kernel.org/r/20221124021208.242541-2-damien.lemoal@opensource.wdc.com
> Signed-off-by: Jens Axboe <axboe@kernel.dk>
> ---
> block/mq-deadline.c | 18 +++++++++++++++---
> 1 file changed, 15 insertions(+), 3 deletions(-)
Now queued up, thanks.
greg k-h
next prev parent reply other threads:[~2023-01-05 11:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-04 14:21 FAILED: patch "[PATCH] block: mq-deadline: Fix dd_finish_request() for zoned devices" failed to apply to 5.15-stable tree gregkh
2023-01-05 4:07 ` [PATCH] block: mq-deadline: Fix dd_finish_request() for zoned devices Damien Le Moal
2023-01-05 11:49 ` Greg Kroah-Hartman [this message]
2023-01-05 4:08 ` FAILED: patch "[PATCH] block: mq-deadline: Fix dd_finish_request() for zoned devices" failed to apply to 5.15-stable tree Damien Le Moal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y7a5SuwQZMB+Q+mr@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=damien.lemoal@opensource.wdc.com \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.