public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Li Feng <fengli@smartx.com>
Cc: Christoph Hellwig <hch@infradead.org>,
	"James E.J. Bottomley" <James.Bottomley@hansenpartnership.com>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	"Martin K. Petersen" <martin.petersen@oracle.com>
Subject: Re: [PATCH] scsi: sd: Keep the discard mode stable
Date: Mon, 17 Jun 2024 23:41:16 -0700	[thread overview]
Message-ID: <ZnEsDHOAjODOS6HJ@infradead.org> (raw)
In-Reply-To: <44BCFE4F-AB66-4E6A-A181-E7D93847EF98@smartx.com>

On Mon, Jun 17, 2024 at 05:03:03PM +0800, Li Feng wrote:
> > But more importantly this doesn't really scale to all the variations
> > of reported / guessed at probe time vs overriden.  I think you just
> > need an explicit override flag that skips the discard settings.
> > 
> I think we only need to prevent the temporary change of discard mode 
> from UNMAP to WS16, and this patch should be enough.
> 
> Maybe it is a good idea to remove the call to sd_config_discard 
> from read_capacity_16 . Because the unmap_alignment/ unmap_granularity
> used by sd_config_discard are assigned in sd_read_block_limits. 
> 
> sd_read_block_limits is enough to negotiate the discard parameter. 
> It is redundant for read_capacity to modify the discard parameter.  In this way, 
> when the SCSI probe sends read_capacity first and then read block limits, 
> it avoids the change of discard from DISABLE to WS16 to UNMAP.

Note that in the linux-next tree for 6.11 we're not only applying
the discard choice to the queue_limits structure and not commiting
it in read_capacity_16.  So it will be overriden before it gets
actually applied.  Can you check that your issue doesn't show up in
linux-next?


  reply	other threads:[~2024-06-18  6:41 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-14 16:03 [PATCH] scsi: sd: Keep the discard mode stable Li Feng
2024-06-17  6:17 ` Christoph Hellwig
2024-06-17  9:03   ` Li Feng
2024-06-18  6:41     ` Christoph Hellwig [this message]
2024-06-19  6:56       ` Li Feng
2024-06-19  7:02         ` Christoph Hellwig
2024-06-17 16:26 ` Benjamin Block
2024-06-18  3:06   ` Li Feng
2024-06-18  8:47     ` Benjamin Block
2024-06-19  6:58       ` Li Feng

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=ZnEsDHOAjODOS6HJ@infradead.org \
    --to=hch@infradead.org \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=fengli@smartx.com \
    --cc=linux-kernel@vger.kernel.org \
    --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