summaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_alloc.h
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2012-10-05 11:06:59 +1000
committerBen Myers <bpm@sgi.com>2012-10-18 17:42:48 -0500
commite04426b9202bccd4cfcbc70b2fa2aeca1c86d8f5 (patch)
tree2bab7921c9327c508d2ea207c9ef781a5df61874 /fs/xfs/xfs_alloc.h
parent2455881c0b52f87be539c4c7deab1afff4d8a560 (diff)
downloadop-kernel-dev-e04426b9202bccd4cfcbc70b2fa2aeca1c86d8f5.zip
op-kernel-dev-e04426b9202bccd4cfcbc70b2fa2aeca1c86d8f5.tar.gz
xfs: move allocation stack switch up to xfs_bmapi_allocate
Switching stacks are xfs_alloc_vextent can cause deadlocks when we run out of worker threads on the allocation workqueue. This can occur because xfs_bmap_btalloc can make multiple calls to xfs_alloc_vextent() and even if xfs_alloc_vextent() fails it can return with the AGF locked in the current allocation transaction. If we then need to make another allocation, and all the allocation worker contexts are exhausted because the are blocked waiting for the AGF lock, holder of the AGF cannot get it's xfs-alloc_vextent work completed to release the AGF. Hence allocation effectively deadlocks. To avoid this, move the stack switch one layer up to xfs_bmapi_allocate() so that all of the allocation attempts in a single switched stack transaction occur in a single worker context. This avoids the problem of an allocation being blocked waiting for a worker thread whilst holding the AGF. Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Mark Tinguely <tinguely@sgi.com> Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_alloc.h')
-rw-r--r--fs/xfs/xfs_alloc.h4
1 files changed, 0 insertions, 4 deletions
diff --git a/fs/xfs/xfs_alloc.h b/fs/xfs/xfs_alloc.h
index ef7d488..feacb06 100644
--- a/fs/xfs/xfs_alloc.h
+++ b/fs/xfs/xfs_alloc.h
@@ -120,10 +120,6 @@ typedef struct xfs_alloc_arg {
char isfl; /* set if is freelist blocks - !acctg */
char userdata; /* set if this is user data */
xfs_fsblock_t firstblock; /* io first block allocated */
- struct completion *done;
- struct work_struct work;
- int result;
- char stack_switch;
} xfs_alloc_arg_t;
/*
OpenPOWER on IntegriCloud