diff options
author | Christoph Hellwig <hch@infradead.org> | 2011-12-06 16:58:19 -0500 |
---|---|---|
committer | Ben Myers <bpm@sgi.com> | 2011-12-14 22:15:42 -0500 |
commit | bf72de3194e73fa210a904b0bd951135286bb385 (patch) | |
tree | 408ead179da91befd82e0cc23ed66830ead2fa59 /fs/xfs/xfs_qm.c | |
parent | 92678554abfc2a2f2727ad168da87d8d434ac904 (diff) |
xfs: nest qm_dqfrlist_lock inside the dquot qlock
Allow xfs_qm_dqput to work without trylock loops by nesting the freelist lock
inside the dquot qlock. In turn that requires trylocks in the reclaim path
instead, but given it's a classic tradeoff between fast and slow path, and
we follow the model of the inode and dentry caches.
Document our new lock order now that it has settled.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_qm.c')
-rw-r--r-- | fs/xfs/xfs_qm.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/xfs/xfs_qm.c b/fs/xfs/xfs_qm.c index f418731e90f4..22360bb26af9 100644 --- a/fs/xfs/xfs_qm.c +++ b/fs/xfs/xfs_qm.c | |||
@@ -1668,7 +1668,9 @@ xfs_qm_dqreclaim_one(void) | |||
1668 | restart: | 1668 | restart: |
1669 | list_for_each_entry(dqp, &xfs_Gqm->qm_dqfrlist, q_freelist) { | 1669 | list_for_each_entry(dqp, &xfs_Gqm->qm_dqfrlist, q_freelist) { |
1670 | struct xfs_mount *mp = dqp->q_mount; | 1670 | struct xfs_mount *mp = dqp->q_mount; |
1671 | xfs_dqlock(dqp); | 1671 | |
1672 | if (!xfs_dqlock_nowait(dqp)) | ||
1673 | continue; | ||
1672 | 1674 | ||
1673 | /* | 1675 | /* |
1674 | * This dquot has already been grabbed by dqlookup. | 1676 | * This dquot has already been grabbed by dqlookup. |