From: Damien Le Moal <dlemoal@kernel.org>
To: sw.prabhu6@gmail.com, James.Bottomley@HansenPartnership.com,
martin.petersen@oracle.com, linux-scsi@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, mcgrof@kernel.org,
pankaj.raghav@linux.dev, bvanassche@acm.org,
Swarna Prabhu <s.prabhu@samsung.com>,
Pankaj Raghav <p.raghav@samsung.com>
Subject: Re: [PATCH v3 1/2] scsi: sd: enable sector size > PAGE_SIZE in scsi sd driver
Date: Tue, 17 Feb 2026 07:56:42 +0900 [thread overview]
Message-ID: <061bb993-f394-4f44-9b6f-4f7ba723d8bc@kernel.org> (raw)
In-Reply-To: <20260214011829.508272-2-sw.prabhu6@gmail.com>
On 2/14/26 10:18, sw.prabhu6@gmail.com wrote:
> From: Swarna Prabhu <sw.prabhu6@gmail.com>
>
> The WRITE SAME(16) and WRITE SAME(10) scsi commands uses
> a page from a dedicated mempool('sd_page_pool') for its
> payload. This pool was initialized to allocate single
> pages, which was sufficient as long as the device sector
> size did not exceed the PAGE_SIZE.
>
> Given that block layer now supports block size upto
> 64K ie beyond PAGE_SIZE, initialize large page pool in
> 'sd_probe()' if a higher sector device is attached ensuring
> atomicity. Adapt 'sd_set_special_bvec()' to use large page
> pool when a higher sector size device is attached. Hence
> enable sector sizes > PAGE_SIZE in scsi sd driver.
>
> 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>
One nit below. With that fixed, feel free to add:
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
> ---
> drivers/scsi/sd.c | 80 ++++++++++++++++++++++++++++++++++++++++-------
> 1 file changed, 68 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
> index d76996d6cbc9..ae6ccfed79b9 100644
> --- a/drivers/scsi/sd.c
> +++ b/drivers/scsi/sd.c
> @@ -107,8 +107,11 @@ static void sd_config_write_same(struct scsi_disk *sdkp,
> static void sd_revalidate_disk(struct gendisk *);
>
> static DEFINE_IDA(sd_index_ida);
> +static DEFINE_MUTEX(sd_mutex_lock);
>
> static mempool_t *sd_page_pool;
> +static mempool_t *sd_large_page_pool;
> +static atomic_t sd_large_page_pool_users = ATOMIC_INIT(0);
> static struct lock_class_key sd_bio_compl_lkclass;
>
> static const char *sd_cache_types[] = {
> @@ -116,6 +119,33 @@ static const char *sd_cache_types[] = {
> "write back, no read (daft)"
> };
>
> +static int sd_large_pool_create_lock(void)
I do not see the point of the "_lock" suffix since you do not have a "no lock"
variant of this function. So let's drop that suffix.
> +static void sd_large_pool_destroy_lock(void)
Same here.
--
Damien Le Moal
Western Digital Research
next prev parent reply other threads:[~2026-02-16 22:56 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-14 1:18 [PATCH v3 0/2] enable sector size > PAGE_SIZE for scsi sw.prabhu6
2026-02-14 1:18 ` [PATCH v3 1/2] scsi: sd: enable sector size > PAGE_SIZE in scsi sd driver sw.prabhu6
2026-02-16 22:56 ` Damien Le Moal [this message]
2026-02-14 1:18 ` [PATCH v3 2/2] scsi: scsi_debug: enable sdebug_sector_size > PAGE_SIZE sw.prabhu6
2026-02-16 22:57 ` Damien Le Moal
2026-03-13 7:26 ` Hannes Reinecke
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=061bb993-f394-4f44-9b6f-4f7ba723d8bc@kernel.org \
--to=dlemoal@kernel.org \
--cc=James.Bottomley@HansenPartnership.com \
--cc=bvanassche@acm.org \
--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=pankaj.raghav@linux.dev \
--cc=s.prabhu@samsung.com \
--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
all inboxes | Powered by JetHome®