On Wed, Jul 03, 2024 at 06:33:45AM +0200, Christoph Hellwig wrote: > 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 :) It's entirely arbitrary -- big enough to exceed MAXEXTLEN*4k, rounded up to the next prime number of gigabytes. > The code itself looks fine, so with a better explanation or more > round number: > > Reviewed-by: Christoph Hellwig <hch@xxxxxx> Thanks! --D