Re: [PATCH v2 09/28] block: Fake max open zones limit when there is no limit

Christoph Hellwig
2024-03-26T06:57:41Z

On Mon, Mar 25, 2024 at 01:44:33PM +0900, Damien Le Moal wrote:
> For a zoned block device that has no limit on the number of open zones
> and no limit on the number of active zones, the zone write plug mempool
> size defaults to 128 zone write plugs. For such case, set the device
> max_open_zones queue limit to this value to indicate to the user the
> potential performance penalty that may happen when writing
> simultaneously to more zones than the mempool size.

zone_hw_limits is a horrible name for
max(lim->max_active_zones, lim->max_open_zones).

But why do we even need it? I'd rather make sure that we always
have valid max_open/active limits, doing something like:

if (!max_open && !max_active)
max_open = max_active = DEFAULT_CAP;
else if (!max_open || WARN_ON_ONCE(max_open > max_active)
max_open = max_active;
else if (!max_active)
max_active = max_open;

and do away with the extra limit. Maybe DEFAULT_CAP should be
tunable as well?