From: Bart Van Assche <bvanassche@acm.org>
To: Kurt Garloff <kurt@garloff.de>, linux-scsi@vger.kernel.org
Subject: Re: Patch [0/3] Support eager_unmap for non ldpme sd devs
Date: Mon, 28 Jul 2025 08:35:09 -0700 [thread overview]
Message-ID: <23ca2980-d097-4f1e-80b4-ca383ea47118@acm.org> (raw)
In-Reply-To: <936a460e-eacd-40a8-834a-76021bf3ce8c@garloff.de>
On 7/27/25 11:06 AM, Kurt Garloff wrote:
> Hi,
>
> (Resent, the original message was not text/plain only. It's too long
> that I have interacted with linux MLs, sorry.)
>
> I had to do some rearrangement of NVMe drives over several of my
> machines recently. I was using a few USB NVMe enclosures for this.
> One of the things that was annoying was that I had no way to discard
> free space using fstrim (or with blkdiscard or mkfs / mkswap options).
>
> The SCSI disk driver (sd_mod) would just claim that discard is not
> supported. It's not true. The NVMes support it as do the enclosures.
> I have a few, though all have variants of RTL9210 chips.
>
> But sd was too conservative to let me do it.
>
> Attached series of patches address this. (Patches are against 6.16.0-rc7.)
>
> 1/3: Introduces an eager_unmap module parameter which lets the sd driver
> unmap/ws16/ws10 capabilities and issue these commands even for
> devices without ldpme support (thin provisioning). The VPD pages are
> being queried for all devices advertising SBC >= 3 to avoid breaking
> old hardware that might barf of being asked for VPDs.
> 2/3: Makes the approach more conservative by guarding the requesting of
> VPD pages also on eager_unmap being set. With this patch, the default
> behavior is the same as before the eager_unmap patches unless the
> parameter is set to non-zero.
> 3/3: This changes the default of eager_unmap to 1. It should be safe based
> on the SBC >= 3 protection, but it's hard to know for sure with all
> the possible broken hardware out there. So leave the parameter for
> admins that need to set it to 0. In case we have significant fallout,
> this is the one patch that would need to get reverted.
>
> I have been running kernels with variants of these patches for over a year
> now.
>
> PS: Please copy me one responses, I have stopped being subscribed to
> LKML and linux-scsi a long time ago. Sorry!
Please use git format-patch --cover-letter ... and git send-email ... to
publish a patch series. Nobody looks at patches included in email
attachments. Please also make sure that your ~/.gitconfig settings match
what is expected for posting patches on Linux kernel mailing lists.
Thanks,
Bart.
next prev parent reply other threads:[~2025-07-28 15:35 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-27 18:06 Patch [0/3] Support eager_unmap for non ldpme sd devs Kurt Garloff
2025-07-28 15:35 ` Bart Van Assche [this message]
2025-07-29 5:09 ` Martin K. Petersen
2025-07-29 7:32 ` Kurt Garloff
2025-07-29 9:15 ` Kurt Garloff
2025-07-29 9:37 ` Kurt Garloff
2025-07-31 4:42 ` Martin K. Petersen
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=23ca2980-d097-4f1e-80b4-ca383ea47118@acm.org \
--to=bvanassche@acm.org \
--cc=kurt@garloff.de \
--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