All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Bart Van Assche <bvanassche@acm.org>
Cc: Jens Axboe <axboe@kernel.dk>,
	linux-block@vger.kernel.org, Christoph Hellwig <hch@lst.de>,
	Damien Le Moal <damien.lemoal@wdc.com>
Subject: Re: [PATCH v2 2/6] block: Introduce the blk_rq_is_zoned_seq_write() function
Date: Fri, 24 Jun 2022 08:07:53 +0200	[thread overview]
Message-ID: <20220624060753.GB6494@lst.de> (raw)
In-Reply-To: <20220623232603.3751912-3-bvanassche@acm.org>

On Thu, Jun 23, 2022 at 04:25:59PM -0700, Bart Van Assche wrote:
> Introduce a function that makes it easy to verify whether a write
> request is for a sequential write required or sequential write preferred
> zone. Simplify blk_req_needs_zone_write_lock() by using the new function.
> 
> Cc: Damien Le Moal <damien.lemoal@wdc.com>
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>
> ---
>  block/blk-zoned.c      | 14 +-------------
>  include/linux/blk-mq.h | 23 +++++++++++++++++++++++
>  2 files changed, 24 insertions(+), 13 deletions(-)
> 
> diff --git a/block/blk-zoned.c b/block/blk-zoned.c
> index 38cd840d8838..cafcbc508dfb 100644
> --- a/block/blk-zoned.c
> +++ b/block/blk-zoned.c
> @@ -57,19 +57,7 @@ EXPORT_SYMBOL_GPL(blk_zone_cond_str);
>   */
>  bool blk_req_needs_zone_write_lock(struct request *rq)
>  {
> -	if (!rq->q->seq_zones_wlock)
> -		return false;
> -
> -	if (blk_rq_is_passthrough(rq))
> -		return false;
> -
> -	switch (req_op(rq)) {
> -	case REQ_OP_WRITE_ZEROES:
> -	case REQ_OP_WRITE:
> -		return blk_rq_zone_is_seq(rq);
> -	default:
> -		return false;
> -	}
> +	return rq->q->seq_zones_wlock && blk_rq_is_zoned_seq_write(rq);
>  }
>  EXPORT_SYMBOL_GPL(blk_req_needs_zone_write_lock);
>  
> diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h
> index 909d47e34b7c..d5930797b84d 100644
> --- a/include/linux/blk-mq.h
> +++ b/include/linux/blk-mq.h
> @@ -1136,6 +1136,24 @@ static inline unsigned int blk_rq_zone_is_seq(struct request *rq)
>  	return blk_queue_zone_is_seq(rq->q, blk_rq_pos(rq));
>  }
>  
> +/**
> + * blk_rq_is_zoned_seq_write() - Whether @rq is a write request for a sequential zone.

This doesn't parse and is overly long at the same time.

  parent reply	other threads:[~2022-06-24  6:08 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-23 23:25 [PATCH v2 0/6] Improve zoned storage write performance Bart Van Assche
2022-06-23 23:25 ` [PATCH v2 1/6] block: Document blk_queue_zone_is_seq() and blk_rq_zone_is_seq() Bart Van Assche
2022-06-24  0:10   ` Damien Le Moal
2022-06-23 23:25 ` [PATCH v2 2/6] block: Introduce the blk_rq_is_zoned_seq_write() function Bart Van Assche
2022-06-24  0:15   ` Damien Le Moal
2022-06-24  6:07   ` Christoph Hellwig [this message]
2022-06-24 16:35     ` Bart Van Assche
2022-06-23 23:26 ` [PATCH v2 3/6] block: Introduce a request queue flag for pipelining zoned writes Bart Van Assche
2022-06-24  0:19   ` Damien Le Moal
2022-06-24 16:29     ` Bart Van Assche
2022-06-23 23:26 ` [PATCH v2 4/6] block/mq-deadline: Only use zone locking if necessary Bart Van Assche
2022-06-24  0:24   ` Damien Le Moal
2022-06-23 23:26 ` [PATCH v2 5/6] block/null_blk: Refactor null_queue_rq() Bart Van Assche
2022-06-24  0:26   ` Damien Le Moal
2022-06-23 23:26 ` [PATCH v2 6/6] block/null_blk: Add support for pipelining zoned writes Bart Van Assche
2022-06-24  0:29   ` Damien Le Moal
2022-06-24  6:06   ` Christoph Hellwig
2022-06-24 16:45     ` Bart Van Assche
2022-06-25  9:25       ` Christoph Hellwig
2022-06-26  0:23         ` Bart Van Assche

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=20220624060753.GB6494@lst.de \
    --to=hch@lst.de \
    --cc=axboe@kernel.dk \
    --cc=bvanassche@acm.org \
    --cc=damien.lemoal@wdc.com \
    --cc=linux-block@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.