On Thu, Oct 01, 2020 at 09:49:30PM -0700, Darrick J. Wong wrote: > From: Darrick J. Wong <darrick.wong@xxxxxxxxxx> > > Refactor xfs_getfsmap to improve its performance: instead of indirectly > calling a function that copies one record to userspace at a time, create > a shadow buffer in the kernel and copy the whole array once at the end. > This should speed it up significantly. So we save an indirect call and uaccess_enable/disable per entry, but pay for it with the cost of a memory allocation (and actually using that memory). Doesn't seem like an obvious win to me, do you have numbers?