From: "Martin K. Petersen" <martin.petersen@oracle.com>
To: "Csordás Hunor" <csordas.hunor@gmail.com>
Cc: Coly Li <colyli@kernel.org>,
hch@lst.de, linux-block@vger.kernel.org,
"James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
linux-scsi@vger.kernel.org, Damien Le Moal <dlemoal@kernel.org>
Subject: Re: Improper io_opt setting for md raid5
Date: Tue, 29 Jul 2025 00:44:07 -0400 [thread overview]
Message-ID: <yq1seiflj0m.fsf@ca-mkp.ca.oracle.com> (raw)
In-Reply-To: <bdf20964-e1ee-45a9-bf24-3396e957ff67@gmail.com> ("Csordás Hunor"'s message of "Sun, 27 Jul 2025 12:50:48 +0200")
Csordás,
I basically agree with everything in your analysis.
>> Then in drivers/scsi/sd.c, inside sd_revalidate_disk() from the following coce,
>> 3785 /*
>> 3786 * Limit default to SCSI host optimal sector limit if set. There may be
>> 3787 * an impact on performance for when the size of a request exceeds this
>> 3788 * host limit.
>> 3789 */
>> 3790 lim.io_opt = sdp->host->opt_sectors << SECTOR_SHIFT;
>> 3791 if (sd_validate_opt_xfer_size(sdkp, dev_max)) {
>> 3792 lim.io_opt = min_not_zero(lim.io_opt,
>> 3793 logical_to_bytes(sdp, sdkp->opt_xfer_blocks));
>> 3794 }
>>
>> lim.io_opt of all my sata disks attached to mpt3sas HBA are all 32767 sectors,
>> because the above code block.
shost->opt_sectors was originally used to seed rw_max and not io_opt, I
think that is the appropriate thing to do.
A SCSI host driver reporting some ludicrous limit is not necessarily
representative of a "good" I/O size as far as neither disk drive, nor
the Linux I/O stack is concerned.
shost->opt_sectors should clearly set an upper bound for max_sectors.
But I don't think we should ever increase any queue limit based on what
is reported in opt_sectors.
--
Martin K. Petersen
prev parent reply other threads:[~2025-07-29 4:44 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <ywsfp3lqnijgig6yrlv2ztxram6ohf5z4yfeebswjkvp2dzisd@f5ikoyo3sfq5>
2025-07-27 10:50 ` Improper io_opt setting for md raid5 Csordás Hunor
2025-07-28 0:39 ` Damien Le Moal
2025-07-28 0:55 ` Yu Kuai
2025-07-28 2:41 ` Damien Le Moal
2025-07-28 3:08 ` Yu Kuai
2025-07-28 3:49 ` Damien Le Moal
2025-07-28 7:14 ` Yu Kuai
2025-07-28 7:44 ` Damien Le Moal
2025-07-28 9:02 ` Yu Kuai
2025-07-29 4:23 ` Martin K. Petersen
2025-07-29 6:25 ` Yu Kuai
2025-07-29 22:02 ` Tony Battersby
2025-07-29 6:13 ` Hannes Reinecke
2025-07-29 6:29 ` Yu Kuai
2025-07-29 22:24 ` Keith Busch
2025-07-28 10:56 ` Csordás Hunor
2025-07-29 4:08 ` Martin K. Petersen
2025-07-29 3:53 ` Martin K. Petersen
2025-07-29 3:49 ` Martin K. Petersen
2025-07-29 4:44 ` Martin K. Petersen [this message]
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=yq1seiflj0m.fsf@ca-mkp.ca.oracle.com \
--to=martin.petersen@oracle.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=colyli@kernel.org \
--cc=csordas.hunor@gmail.com \
--cc=dlemoal@kernel.org \
--cc=hch@lst.de \
--cc=linux-block@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
/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