public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* Patch [0/3] Support eager_unmap for non ldpme sd devs
@ 2025-07-27 18:06 Kurt Garloff
  2025-07-28 15:35 ` Bart Van Assche
  2025-07-29  5:09 ` Martin K. Petersen
  0 siblings, 2 replies; 7+ messages in thread
From: Kurt Garloff @ 2025-07-27 18:06 UTC (permalink / raw)
  To: linux-scsi

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!

-- 
Kurt Garloff <kurt@garloff.de>, Cologne


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-07-31  4:43 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox