[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <985ae28e-1547-46a5-bff0-5925b6544a6d@kernel.org>
Date: Sat, 13 Dec 2025 12:25:18 +0900
From: Damien Le Moal <dlemoal@...nel.org>
To: Pankaj Raghav <kernel@...kajraghav.com>, sw.prabhu6@...il.com,
James.Bottomley@...senPartnership.com, martin.petersen@...cle.com,
linux-scsi@...r.kernel.org
Cc: bvanassche@....org, linux-kernel@...r.kernel.org, mcgrof@...nel.org,
stable@...r.kernel.org, Swarna Prabhu <s.prabhu@...sung.com>,
Pankaj Raghav <p.raghav@...sung.com>
Subject: Re: [PATCH 1/2] scsi: sd: fix write_same(16/10) to enable sector size
> PAGE_SIZE
On 2025/12/12 8:53, Pankaj Raghav wrote:
>>> Cc: stable@...r.kernel.org Signed-off-by: Swarna Prabhu
>>> <s.prabhu@...sung.com> Co-developed-by: Pankaj Raghav
>>> <p.raghav@...sung.com> Signed-off-by: Pankaj Raghav
>>> <p.raghav@...sung.com> --- Note: We are allocating pages of order
>>> aligned to BLK_MAX_BLOCK_SIZE for the mempool page allocator
>>> 'sd_page_pool' all the time. This is because we only know that a bigger
>>> sector size device is attached at sd_probe and it might be too late to
>>> reallocate mempool with order >0.
>>
>> That is a lot heavier on the memory for the vast majority of devices which
>> are 512B or 4K block size... It may be better to have the special "large
>> block" mempool attached to the scsi disk struct and keep the default
>> single page mempool for all other regular devices.
>>
>
> We had the same feeling as well and we mentioned it in the 1st RFC.
>
> But when will you initialize the mempool for the large block devices? I
> don't think it makes sense to unconditionally initialize it in init_sd. Do
> we do it during the sd_probe() when we first encounter a large block device?
> That way we may not waste any memory if no large block devices are attached.
That sounds reasonable to me. Any system that has a device with a large sector
size will get this mempool initialized when the first such device is scanned,
and systems with regular disks (the vast majority of cases for scsi) will not.
You may want to be careful with that initialization in sd_probe() though: scsi
device scan is asynchronous and done in parallel for multiple devices, so you
will need some atomicity for checking the mempool existence and initializing it
if needed.
--
Damien Le Moal
Western Digital Research
Powered by blists - more mailing lists