提交 9552e14d 编写于 作者: D Dave Chinner 提交者: Darrick J. Wong

xfs: don't block inode reclaim on the ILOCK

When we attempt to reclaim an inode, the first thing we do is take
the inode lock. This is blocking right now, so if the inode being
accessed by something else (e.g. being flushed to the cluster
buffer) we will block here.

Change this to a trylock so that we do not block inode reclaim
unnecessarily here.
Signed-off-by: NDave Chinner <dchinner@redhat.com>
Reviewed-by: NDarrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: NBrian Foster <bfoster@redhat.com>
Signed-off-by: NDarrick J. Wong <darrick.wong@oracle.com>
上级 0e8e2c63
...@@ -1119,9 +1119,10 @@ xfs_reclaim_inode( ...@@ -1119,9 +1119,10 @@ xfs_reclaim_inode(
{ {
xfs_ino_t ino = ip->i_ino; /* for radix_tree_delete */ xfs_ino_t ino = ip->i_ino; /* for radix_tree_delete */
xfs_ilock(ip, XFS_ILOCK_EXCL); if (!xfs_ilock_nowait(ip, XFS_ILOCK_EXCL))
if (!xfs_iflock_nowait(ip))
goto out; goto out;
if (!xfs_iflock_nowait(ip))
goto out_iunlock;
if (XFS_FORCED_SHUTDOWN(ip->i_mount)) { if (XFS_FORCED_SHUTDOWN(ip->i_mount)) {
xfs_iunpin_wait(ip); xfs_iunpin_wait(ip);
...@@ -1188,8 +1189,9 @@ xfs_reclaim_inode( ...@@ -1188,8 +1189,9 @@ xfs_reclaim_inode(
out_ifunlock: out_ifunlock:
xfs_ifunlock(ip); xfs_ifunlock(ip);
out: out_iunlock:
xfs_iunlock(ip, XFS_ILOCK_EXCL); xfs_iunlock(ip, XFS_ILOCK_EXCL);
out:
xfs_iflags_clear(ip, XFS_IRECLAIM); xfs_iflags_clear(ip, XFS_IRECLAIM);
return false; return false;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册