linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Damien Le Moal <dlemoal@kernel.org>
Cc: Jens Axboe <axboe@kernel.dk>,
	linux-block@vger.kernel.org, Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH 1/2] block: remove blk_zone_wp_offset()
Date: Thu, 6 Nov 2025 12:03:16 +0100	[thread overview]
Message-ID: <20251106110316.GB30278@lst.de> (raw)
In-Reply-To: <20251106070627.96995-2-dlemoal@kernel.org>

On Thu, Nov 06, 2025 at 04:06:26PM +0900, Damien Le Moal wrote:
> The helper function blk_zone_wp_offset() is called from
> disk_zone_wplug_sync_wp_offset(), and again called from
> blk_revalidate_seq_zone() right after the call to
> disk_zone_wplug_sync_wp_offset().
> 
> Change disk_zone_wplug_sync_wp_offset() to return the wp_offset it used
> for updating the target zone write plug to avoid this double call. With
> this change, blk_zone_wp_offset() can be open coded directly in
> disk_zone_wplug_sync_wp_offset(). This open-coding introduces 2 changes:
> handle the BLK_COND_ZONE_ACTIVE case, and return UINT_MAX as the
> wp_offset for a full zone, since the write pointer of full zones is
> invalid.
> 
> For the case where a zone does not have a zone write plug,
> disk_zone_wplug_sync_wp_offset() does nothing and returns 0. This in
> turn leads to blk_revalidate_seq_zone() to immediately return, which is
> exactly what we want (because there is no need to attempt removing a
> zone write plug that does not exist).

I like the use of disk_zone_wplug_sync_wp_offset in
blk_revalidate_seq_zone, but having the switch on the zone conditions
in a separate helper seems nicer than open coding it next to the
write plug handling.


  reply	other threads:[~2025-11-06 11:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-06  7:06 [PATCH 0/2] Zone related cleanups Damien Le Moal
2025-11-06  7:06 ` [PATCH 1/2] block: remove blk_zone_wp_offset() Damien Le Moal
2025-11-06 11:03   ` Christoph Hellwig [this message]
2025-11-06  7:06 ` [PATCH 2/2] block: introduce bdev_zone_start() Damien Le Moal
2025-11-06 11:03   ` Christoph Hellwig
2025-11-06 16:02   ` 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=20251106110316.GB30278@lst.de \
    --to=hch@lst.de \
    --cc=axboe@kernel.dk \
    --cc=dlemoal@kernel.org \
    --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 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).