xfs: cache pages used for xfarray quicksort convergence
authorDarrick J. Wong <djwong@kernel.org>
Thu, 10 Aug 2023 14:48:06 +0000 (07:48 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Thu, 10 Aug 2023 14:48:06 +0000 (07:48 -0700)
commitcf36f4f64c2d4e928b6fdfff06d8e21561e3e32f
treeacf89996640aceaf8076587591ba190a6a577581
parente5b46c75892ecd83b49beea08b234a4e496534f8
xfs: cache pages used for xfarray quicksort convergence

After quicksort picks a pivot item for a particular subsort, it walks
the records in that subset from the outside in, rearranging them so that
every record less than the pivot comes before it, and every record
greater than the pivot comes after it.  This scan has a lot of locality,
so we can speed it up quite a bit by grabbing the xfile backing page and
holding onto it as long as we possibly can.  Doing so reduces the
runtime by another 5% on the author's computer.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Kent Overstreet <kent.overstreet@linux.dev>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
fs/xfs/scrub/xfarray.c
fs/xfs/scrub/xfile.h