On Tue, Jul 02, 2024 at 07:36:27AM +0200, Christoph Hellwig wrote: > On Mon, Jul 01, 2024 at 06:04:41PM -0700, Darrick J. Wong wrote: > > Add a new -o fstrim_pct= option to xfs_scrub just in case there are > > users out there who want a different percentage. For example, accepting > > a 95% trim would net us a speed increase of nearly two orders of > > magnitude, ignoring system call overhead. Setting it to 100% will trim > > everything, just like fstrim(8). > > It might also make sense to default the parameter to the > discard_granularity reported in sysfs. While a lot of devices don't > report a useful value there, it avoids pointless work for those that > do. Oooh, that's a good idea. Let me fiddle with that & tack it on the end? Hmm. How do we query the discard granularity from a userspace program? I can try to guess the /sys/block/XXX root from the devices passed in, or maybe libblkid will tell me? And then I'd have to go open queue/discard_granularity underneath that to read that. That's going to take a day or so, I suspect. :/ > Otherwise this looks good: > > Reviewed-by: Christoph Hellwig <hch@xxxxxx> Thanks! --D