xfs: remove SYNC_TRYLOCK from inode reclaim
authorDave Chinner <dchinner@redhat.com>
Wed, 1 Jul 2020 17:21:05 +0000 (10:21 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Tue, 7 Jul 2020 14:15:08 +0000 (07:15 -0700)
commit50718b8d73dda01bb168f9f3b16f6311a2debe7b
tree232aafdfa1c1e60e051bddd5bc8263690f17d25e
parent9552e14d3e879a3b4281427ef368271f371ea167
xfs: remove SYNC_TRYLOCK from inode reclaim

All background reclaim is SYNC_TRYLOCK already, and even blocking
reclaim (SYNC_WAIT) can use trylock mechanisms as
xfs_reclaim_inodes_ag() will keep cycling until there are no more
reclaimable inodes. Hence we can kill SYNC_TRYLOCK from inode
reclaim and make everything unconditionally non-blocking.

We remove all the optimistic "avoid blocking on locks" checks done
in xfs_reclaim_inode_grab() as nothing blocks on locks anymore.
Further, checking XFS_IFLOCK optimistically can result in detecting
inodes in the process of being cleaned (i.e. between being removed
from the AIL and having the flush lock dropped), so for
xfs_reclaim_inodes() to reliably reclaim all inodes we need to drop
these checks anyway.

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