From: Damien Le Moal <dlemoal@kernel.org>
To: SSiwinski@atto.com, Christoph Hellwig <hch@infradead.org>
Cc: bgrove@atto.com, James.Bottomley@hansenpartnership.com,
linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org,
martin.petersen@oracle.com,
Steve Siwinski <stevensiwinski@gmail.com>
Subject: Re: [PATCH] scsi: sd_zbc: Limit the report zones buffer size to UIO_MAXIOV
Date: Sat, 19 Apr 2025 06:29:19 +0900 [thread overview]
Message-ID: <8454a55d-bfcc-441a-837e-157123e881fe@kernel.org> (raw)
In-Reply-To: <OFA5AB0241.ED5C089D-ON85258C70.0068BDE0-85258C70.00721A7A@atto.com>
On 4/19/25 05:46, SSiwinski@atto.com wrote:
>
> "Christoph Hellwig" <hch@infradead.org> wrote on 04/14/2025 01:52:31 AM:
>
>> On Fri, Apr 11, 2025 at 04:36:00PM -0400, Steve Siwinski wrote:
>>> The report zones buffer size is currently limited by the HBA's
>>> maximum segment count to ensure the buffer can be mapped. However,
>>> the user-space SG_IO interface further limits the number of iovec
>>> entries to UIO_MAXIOV when allocating a bio.
>>
>> Why does the userspace SG_IO interface matter here?
>> sd_zbc_alloc_report_buffer is only used for the in-kernel
>> ->report_zones call.
>
> I was referring to the userspace SG_IO limitation (UIO_MAXIOV) in
> bio_kmalloc(), which gets called when the report zones command is
> executed and the buffer mapped in bio_map_kern().
>
> Perhaps my wording here was poor and this is really a limitation of bio?
sd_zbc_alloc_report_buffer() is called only from sd_zbc_report_zones() which is
the disk ->report_zones() operations, which is NOT called for passthrough
commands. So modifying sd_zbc_alloc_report_buffer() will not help in any way
solving your issue with an SG_IO passthrough report zones command issued by the
user.
For reference, libzbc uses ioctl(SG_GET_SG_TABLESIZE) * sysconf(_SC_PAGESIZE) as
the max buffer size and allocates page aligned buffers to avoid these SG_IO
buffer mapping limitations.
--
Damien Le Moal
Western Digital Research
next prev parent reply other threads:[~2025-04-18 21:29 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-11 20:36 [PATCH] scsi: sd_zbc: Limit the report zones buffer size to UIO_MAXIOV Steve Siwinski
2025-04-14 5:52 ` Christoph Hellwig
[not found] ` <OFA5AB0241.ED5C089D-ON85258C70.0068BDE0-85258C70.00721A7A@atto.com>
2025-04-18 21:29 ` Damien Le Moal [this message]
2025-04-24 15:33 ` Siwinski, Steve
2025-04-25 1:42 ` Damien Le Moal
2025-04-30 14:06 ` Christoph Hellwig
2025-05-02 19:35 ` [PATCH v2] block, scsi: sd_zbc: Respect bio vector limits for report zones buffer Steve Siwinski
2025-05-06 2:29 ` Damien Le Moal
2025-05-08 20:01 ` [PATCH v3] " Steve Siwinski
2025-05-08 23:08 ` 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=8454a55d-bfcc-441a-837e-157123e881fe@kernel.org \
--to=dlemoal@kernel.org \
--cc=James.Bottomley@hansenpartnership.com \
--cc=SSiwinski@atto.com \
--cc=bgrove@atto.com \
--cc=hch@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=stevensiwinski@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