On Tue, Jul 02, 2024 at 08:52:27PM -0700, Darrick J. Wong wrote: > I then had the idea to limit the length parameter of each call to a > smallish amount (~11GB) so that we could report progress relatively > quickly, but much to my surprise, each FITRIM call still took ~68 > seconds! Where do those magic 11GB come from? > +/* > + * Limit the amount of fstrim scanning that we let the kernel do in a single > + * call so that we can implement decent progress reporting and CPU resource > + * control. Pick a prime number of gigabytes for interest. ... this explains it somehow, but not really :) The code itself looks fine, so with a better explanation or more round number: Reviewed-by: Christoph Hellwig <hch@xxxxxx>