public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: lukas@herbolt.com
To: John Garry <john.g.garry@oracle.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>,
	James.Bottomley@hansenpartnership.com,
	linux-scsi@vger.kernel.org
Subject: Re: [PATCH 1/1] scsi: sd: Rounddown host->opt_sectors to logical
Date: Fri, 21 Nov 2025 09:34:25 +0100	[thread overview]
Message-ID: <0bf87d8b077299841716ad55d7a35d77@herbolt.com> (raw)
In-Reply-To: <4728a1b9-7282-4cd3-8a36-5d8f19bd1cc0@oracle.com>

On 2025-11-20 17:07, John Garry wrote:
> On 20/11/2025 03:26, Martin K. Petersen wrote:
>> 
>> Lukas,
>> 
>>> The host->opt_sectors are by default 512 bytes aligned if we have 4KN
>>> SAS disk reporting zero or smaller opt_xfer_block than the
>>> host->opt_sectors we will end up with unaligned queue_limit->io_opt.
>> 
>> I am intrigued wrt. which controller returns a host->opt_sectors that
>> would trigger this misalignment. What is the actual value reported?
>> 
>>> +	lim.io_opt = rounddown(lim.logical_block_size,
>>> +			sdp->host->opt_sectors << SECTOR_SHIFT);
>> 
>> Those parameters would need to be reversed, I think. You want to round
>> down opt_sectors and not the logical_block_size.
>> 
> 
> In blk_validate_limits(), we already round down lim.io_opt to physical 
> block size, and physical block size >= logical block size (so this 
> extra rounding down should not be required). What am I missing?


Right, I overlooked it. The problematic kernel I was running is before 
this patch
9c0ba14828d64744ccd195c610594ba254a1a9ab which is setting the lim.io_opt 
to the proper value.

Thanks for the help!

      reply	other threads:[~2025-11-21  8:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-14 10:28 [PATCH 0/1] Fix unaligned queue_limit->io_opt on SAS and 4KN disk Lukas Herbolt
2025-11-14 10:28 ` [PATCH 1/1] scsi: sd: Rounddown host->opt_sectors to logical Lukas Herbolt
2025-11-20  3:26   ` Martin K. Petersen
2025-11-20 12:07     ` lukas
2025-11-20 16:07     ` John Garry
2025-11-21  8:34       ` lukas [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=0bf87d8b077299841716ad55d7a35d77@herbolt.com \
    --to=lukas@herbolt.com \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=john.g.garry@oracle.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.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