linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Damien Le Moal <damien.lemoal@opensource.wdc.com>
To: Pankaj Raghav <p.raghav@samsung.com>,
	linux-block@vger.kernel.org, axboe@kernel.dk
Cc: gost.dev@samsung.com
Subject: Re: [PATCH 1/2] block: modify blk_mq_plug() to allow only reads for zoned block devices
Date: Mon, 26 Sep 2022 07:55:13 +0900	[thread overview]
Message-ID: <736c593b-a8cb-0e68-c895-cb89bc29b68e@opensource.wdc.com> (raw)
In-Reply-To: <20220925185348.120964-2-p.raghav@samsung.com>

On 9/26/22 03:53, Pankaj Raghav wrote:
> Modify blk_mq_plug() to allow plugging only for read operations in zoned
> block devices as there are alternative IO paths in the linux block
> layer which can end up doing a write via driver private requests in
> sequential write zones.
> 
> Signed-off-by: Pankaj Raghav <p.raghav@samsung.com>
> ---
>   block/blk-mq.h | 7 ++++---
>   1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/block/blk-mq.h b/block/blk-mq.h
> index 8ca453ac243d..005343df64ca 100644
> --- a/block/blk-mq.h
> +++ b/block/blk-mq.h
> @@ -305,14 +305,15 @@ static inline void blk_mq_clear_mq_map(struct blk_mq_queue_map *qmap)
>    * change can cause write BIO failures with zoned block devices as these
>    * require sequential write patterns to zones. Prevent this from happening by
>    * ignoring the plug state of a BIO issuing context if it is for a zoned block
> - * device and the BIO to plug is a write operation.
> + * device and the BIO to plug is not a read operation.
> + *
>    *
>    * Return current->plug if the bio can be plugged and NULL otherwise
>    */
>   static inline struct blk_plug *blk_mq_plug( struct bio *bio)
>   {
> -	/* Zoned block device write operation case: do not plug the BIO */
> -	if (bdev_is_zoned(bio->bi_bdev) && op_is_write(bio_op(bio)))
> +	/* Allow plugging only for read operations in zoned block devices */

nit: s/in/with

> +	if (bdev_is_zoned(bio->bi_bdev) && bio_op(bio) != REQ_OP_READ)
>   		return NULL;
>   
>   	/*

Otherwise, looks good to me.

Reviewed-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>

-- 
Damien Le Moal
Western Digital Research


  reply	other threads:[~2022-09-25 22:55 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20220925185349eucas1p1dc689bac64668ca038ba8646c44fd580@eucas1p1.samsung.com>
2022-09-25 18:53 ` [PATCH 0/2] enable plugging only for reads in zoned block devices Pankaj Raghav
     [not found]   ` <CGME20220925185350eucas1p1fc354429027a88de7e548a3a4529b4ef@eucas1p1.samsung.com>
2022-09-25 18:53     ` [PATCH 1/2] block: modify blk_mq_plug() to allow only reads for " Pankaj Raghav
2022-09-25 22:55       ` Damien Le Moal [this message]
2022-09-26 14:37       ` Christoph Hellwig
2022-09-26 14:40         ` Jens Axboe
2022-09-26 14:43           ` Christoph Hellwig
2022-09-26 16:32             ` Jens Axboe
2022-09-26 19:20               ` Pankaj Raghav
2022-09-26 19:25                 ` Jens Axboe
2022-09-27 15:20                   ` Pankaj Raghav
2022-09-27 16:04                     ` Jens Axboe
2022-09-27 16:51                       ` Christoph Hellwig
2022-09-27 16:52                         ` Jens Axboe
2022-09-27 23:07                           ` Damien Le Moal
2022-09-27 23:10                             ` Damien Le Moal
2022-09-27 23:13                               ` Jens Axboe
2022-09-27 23:12                             ` Jens Axboe
2022-09-27 23:35                               ` Damien Le Moal
2022-09-28 11:57                           ` Pankaj Raghav
2022-09-28 22:19                             ` Damien Le Moal
     [not found]   ` <CGME20220925185351eucas1p1e0c37396c09611509c0b18bdcdeddfe1@eucas1p1.samsung.com>
2022-09-25 18:53     ` [PATCH 2/2] block: use blk_mq_plug() in blk_execute_rq_nowait() Pankaj Raghav
2022-09-25 22:56       ` 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=736c593b-a8cb-0e68-c895-cb89bc29b68e@opensource.wdc.com \
    --to=damien.lemoal@opensource.wdc.com \
    --cc=axboe@kernel.dk \
    --cc=gost.dev@samsung.com \
    --cc=linux-block@vger.kernel.org \
    --cc=p.raghav@samsung.com \
    /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 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).