Re: [PATCH 06/13] block: use zone condition to determine conventional zones

Damien Le Moal
2025-11-03T06:00:19Z

On 11/1/25 06:04, Bart Van Assche wrote:
>> static int disk_revalidate_zone_resources(struct gendisk *disk,
>> - unsigned int nr_zones)
>> + struct blk_revalidate_zone_args *args)
>> {
>> struct queue_limits *lim = &disk->queue->limits;
>> unsigned int pool_size;
>>
>> + args->disk = disk;
>> + args->nr_zones =
>> + DIV_ROUND_UP_ULL(get_capacity(disk), lim->chunk_sectors);
>> +
>> + /* Cached zone conditions: 1 byte per zone */
>> + args->zones_cond = kzalloc(args->nr_zones, GFP_NOIO);
>> + if (!args->zones_cond)
>> + return -ENOMEM;
>
> Why args->nr_zones as array size instead of args->nr_conv_zones? The
> patch description says that this array is only used for conventional
> zones.

The bitmap before was of nr_zones bits, because conventional zones can be
anywhere in the LBA space. The same is still true using zone conditions. We need
one condition per zone for all zones.

--
Damien Le Moal
Western Digital Research