[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <61a72147-292f-b1d0-fbfd-5b34d71a69a0@samsung.com>
Date: Wed, 4 May 2022 20:46:50 +0200
From: Pankaj Raghav <p.raghav@...sung.com>
To: Hannes Reinecke <hare@...e.de>,
Damien Le Moal <damien.lemoal@...nsource.wdc.com>,
<jaegeuk@...nel.org>, <axboe@...nel.dk>, <snitzer@...nel.org>,
<hch@....de>, <mcgrof@...nel.org>, <naohiro.aota@....com>,
<sagi@...mberg.me>, <dsterba@...e.com>,
<johannes.thumshirn@....com>
CC: <linux-kernel@...r.kernel.org>, <clm@...com>,
<gost.dev@...sung.com>, <chao@...nel.org>, <josef@...icpanda.com>,
<jonathan.derrick@...ux.dev>, <agk@...hat.com>,
<kbusch@...nel.org>, <kch@...dia.com>,
<linux-nvme@...ts.infradead.org>, <bvanassche@....org>,
<jiangbo.365@...edance.com>, <matias.bjorling@....com>,
<linux-block@...r.kernel.org>
Subject: Re: [PATCH 04/16] block: allow blk-zoned devices to have
non-power-of-2 zone size
Hi Hannes,
Somehow your message did not go through the mailing list. Maybe you hit
reply instead of reply all?
I have added your reviewed-by tag in the other commits based on your
response. Thanks.
Anyway, my response to this email below:
On 2022-05-04 18:59, Hannes Reinecke wrote:
> On 4/27/22 09:02, Pankaj Raghav wrote:
>> zone size (%llu)\n",
>> - disk->disk_name, zone->len);
>> + if (zone->len == 0) {
>> + pr_warn("%s: Invalid zoned device size",
>> + disk->disk_name);
>> return -ENODEV;
>> }
>> args->zone_sectors = zone->len;
>> - args->nr_zones = (capacity + zone->len - 1) >> ilog2(zone->len);
>> + args->nr_zones = div64_u64(capacity + zone->len - 1, zone->len);
>
> This is a different calculation than the one you're using in the first
> patch. Can you please add a helper such that both are using the same
> calculation?
>
So this calculation is actually doing a roundup to the nearest zone
number operation and not just a division that is done in the block layer
helper such as bdev_zone_no(). Note the `zone->len - 1` added to the
capacity. This is done to take into account also the last unequal zone
size, if present.
Another thing to note is that block layer helpers cannot be used here
because at this point we haven't set the chunk sectors and we are still
in the revalidation callback.
Maybe some comments on top of this will help to avoid any confusion?
What do you think? And, I am not aware of any generic helper in math.h
that does this operation for both 32 and 64 bit architecture.
Regards,
Pankaj
Powered by blists - more mailing lists