From: Christoph Hellwig <hch@lst.de>
To: Damien Le Moal <dlemoal@kernel.org>
Cc: Jens Axboe <axboe@kernel.dk>,
linux-block@vger.kernel.org, dm-devel@lists.linux.dev,
Mike Snitzer <snitzer@kernel.org>,
Mikulas Patocka <mpatocka@redhat.com>,
Christoph Hellwig <hch@lst.de>,
Benjamin Marzinski <bmarzins@redhat.com>
Subject: Re: [PATCH v2 2/2] dm: Improve zone resource limits handling
Date: Wed, 5 Jun 2024 06:23:11 +0200 [thread overview]
Message-ID: <20240605042311.GB12183@lst.de> (raw)
In-Reply-To: <20240605022445.105747-3-dlemoal@kernel.org>
On Wed, Jun 05, 2024 at 11:24:45AM +0900, Damien Le Moal wrote:
> The generic stacking of limits implemented in the block layer cannot
> correctly handle stacking of zone resource limits (max open zones and
> max active zones)
... for DM. All other limits stacking ends up in a single top device.
> + /*
> + * If the target does not map all sequential zones, the limits
> + * will not be reliable.
> + */
> + if (zc.target_nr_seq_zones < zc.total_nr_seq_zones)
> + zlim->reliable_limits = false;
> +
> + /*
> + * If the target maps less sequential zones than the limit values, then
> + * we do not have limits for this target.
> + */
> + max_active_zones = disk->queue->limits.max_active_zones;
> + if (max_active_zones >= zc.target_nr_seq_zones)
> + max_active_zones = 0;
> + zlim->max_active_zones =
> + min_not_zero(max_active_zones, zlim->max_active_zones);
> +
> + max_open_zones = disk->queue->limits.max_open_zones;
> + if (max_open_zones >= zc.target_nr_seq_zones)
> + max_open_zones = 0;
> + zlim->max_open_zones =
> + min_not_zero(max_open_zones, zlim->max_open_zones);
Given that your previous patch already caps max_open/active_zones to the
number of sequential zones, duplicating this here should not be needed.
> + /* We cannot have more open zones than active zones. */
> + zlim->max_open_zones =
> + min(zlim->max_open_zones, zlim->max_active_zones);
Same question about the capping as in patch 1, and same comment about
the duplication as above.
> + if (zlim.max_open_zones >= zlim.mapped_nr_seq_zones)
> + lim->max_open_zones = 0;
> + else
> + lim->max_open_zones = zlim.max_open_zones;
> +
> + if (zlim.max_active_zones >= zlim.mapped_nr_seq_zones)
> + lim->max_active_zones = 0;
> + else
> + lim->max_active_zones = zlim.max_active_zones;
And once more here.
next prev parent reply other threads:[~2024-06-05 4:23 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-05 2:24 [PATCH v2 0/2] Fix DM zone resource limits stacking Damien Le Moal
2024-06-05 2:24 ` [PATCH v2 1/2] block: Imporve checks on zone resource limits Damien Le Moal
2024-06-05 4:17 ` Christoph Hellwig
2024-06-05 4:52 ` Damien Le Moal
2024-06-05 2:24 ` [PATCH v2 2/2] dm: Improve zone resource limits handling Damien Le Moal
2024-06-05 4:23 ` Christoph Hellwig [this message]
2024-06-05 4:55 ` Damien Le Moal
2024-06-05 2:26 ` [PATCH v2 0/2] Fix DM zone resource limits stacking 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=20240605042311.GB12183@lst.de \
--to=hch@lst.de \
--cc=axboe@kernel.dk \
--cc=bmarzins@redhat.com \
--cc=dlemoal@kernel.org \
--cc=dm-devel@lists.linux.dev \
--cc=linux-block@vger.kernel.org \
--cc=mpatocka@redhat.com \
--cc=snitzer@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