public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Damien Le Moal <dlemoal@kernel.org>
To: Pankaj Raghav <kernel@pankajraghav.com>,
	sw.prabhu6@gmail.com, James.Bottomley@HansenPartnership.com,
	martin.petersen@oracle.com, linux-scsi@vger.kernel.org
Cc: bvanassche@acm.org, linux-kernel@vger.kernel.org,
	mcgrof@kernel.org, stable@vger.kernel.org,
	Swarna Prabhu <s.prabhu@samsung.com>,
	Pankaj Raghav <p.raghav@samsung.com>
Subject: Re: [PATCH 1/2] scsi: sd: fix write_same(16/10) to enable sector size > PAGE_SIZE
Date: Sat, 13 Dec 2025 12:25:18 +0900	[thread overview]
Message-ID: <985ae28e-1547-46a5-bff0-5925b6544a6d@kernel.org> (raw)
In-Reply-To: <934c62d1-c800-4b31-9774-1e9dfe661877@pankajraghav.com>

On 2025/12/12 8:53, Pankaj Raghav wrote:
>>> Cc: stable@vger.kernel.org Signed-off-by: Swarna Prabhu
>>> <s.prabhu@samsung.com> Co-developed-by: Pankaj Raghav
>>> <p.raghav@samsung.com> Signed-off-by: Pankaj Raghav
>>> <p.raghav@samsung.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

  reply	other threads:[~2025-12-13  3:25 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-10  1:41 [v1 0/2] enable sector size > PAGE_SIZE for scsi sw.prabhu6
2025-12-10  1:41 ` [PATCH 1/2] scsi: sd: fix write_same(16/10) to enable sector size > PAGE_SIZE sw.prabhu6
2025-12-10  1:52   ` Damien Le Moal
2025-12-11 23:53     ` Pankaj Raghav
2025-12-13  3:25       ` Damien Le Moal [this message]
2025-12-10  1:41 ` [PATCH 2/2] scsi: scsi_debug: enable sdebug_sector_size " sw.prabhu6
2025-12-10  1:56 ` [v1 0/2] enable sector size > PAGE_SIZE for scsi Damien Le Moal
2025-12-12  0:18   ` Swarna Prabhu
2025-12-13  3:22     ` Damien Le Moal
  -- strict thread matches above, loose matches on Subject: below --
2026-02-11  1:50 [PATCH v2 " sw.prabhu6
2026-02-11  1:50 ` [PATCH 1/2] scsi: sd: fix write_same(16/10) to enable sector size > PAGE_SIZE sw.prabhu6
2026-02-11  8:55   ` 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=985ae28e-1547-46a5-bff0-5925b6544a6d@kernel.org \
    --to=dlemoal@kernel.org \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=bvanassche@acm.org \
    --cc=kernel@pankajraghav.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=mcgrof@kernel.org \
    --cc=p.raghav@samsung.com \
    --cc=s.prabhu@samsung.com \
    --cc=stable@vger.kernel.org \
    --cc=sw.prabhu6@gmail.com \
    /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