xfs: calculate inode walk prefetch more carefully
authorDarrick J. Wong <darrick.wong@oracle.com>
Tue, 2 Jul 2019 16:39:40 +0000 (09:39 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Tue, 2 Jul 2019 16:40:05 +0000 (09:40 -0700)
commit938c710d99a62eed93b6a2770f92f943762beca0
treee58cd5750ad32c6aca19b054081026be4cecf8c4
parent2810bd6840e46306c110f4b76441a987756efe6c
xfs: calculate inode walk prefetch more carefully

The existing inode walk prefetch is based on the old bulkstat code,
which simply allocated 4 pages worth of memory and prefetched that many
inobt records, regardless of however many inodes the caller requested.
65536 inodes is a lot to prefetch (~32M on x64, ~512M on arm64) so let's
scale things down a little more intelligently based on the number of
inodes requested, etc.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
fs/xfs/xfs_iwalk.c