aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_alloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_alloc.c')
-rw-r--r--fs/xfs/xfs_alloc.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/fs/xfs/xfs_alloc.c b/fs/xfs/xfs_alloc.c
index 229641fb8e67..4f33c32affe3 100644
--- a/fs/xfs/xfs_alloc.c
+++ b/fs/xfs/xfs_alloc.c
@@ -1074,12 +1074,13 @@ restart:
1074 * If we couldn't get anything, give up. 1074 * If we couldn't get anything, give up.
1075 */ 1075 */
1076 if (bno_cur_lt == NULL && bno_cur_gt == NULL) { 1076 if (bno_cur_lt == NULL && bno_cur_gt == NULL) {
1077 xfs_btree_del_cursor(cnt_cur, XFS_BTREE_NOERROR);
1078
1077 if (!forced++) { 1079 if (!forced++) {
1078 trace_xfs_alloc_near_busy(args); 1080 trace_xfs_alloc_near_busy(args);
1079 xfs_log_force(args->mp, XFS_LOG_SYNC); 1081 xfs_log_force(args->mp, XFS_LOG_SYNC);
1080 goto restart; 1082 goto restart;
1081 } 1083 }
1082
1083 trace_xfs_alloc_size_neither(args); 1084 trace_xfs_alloc_size_neither(args);
1084 args->agbno = NULLAGBLOCK; 1085 args->agbno = NULLAGBLOCK;
1085 return 0; 1086 return 0;
@@ -2433,15 +2434,24 @@ xfs_alloc_vextent_worker(
2433 current_restore_flags_nested(&pflags, PF_FSTRANS); 2434 current_restore_flags_nested(&pflags, PF_FSTRANS);
2434} 2435}
2435 2436
2436 2437/*
2437int /* error */ 2438 * Data allocation requests often come in with little stack to work on. Push
2439 * them off to a worker thread so there is lots of stack to use. Metadata
2440 * requests, OTOH, are generally from low stack usage paths, so avoid the
2441 * context switch overhead here.
2442 */
2443int
2438xfs_alloc_vextent( 2444xfs_alloc_vextent(
2439 xfs_alloc_arg_t *args) /* allocation argument structure */ 2445 struct xfs_alloc_arg *args)
2440{ 2446{
2441 DECLARE_COMPLETION_ONSTACK(done); 2447 DECLARE_COMPLETION_ONSTACK(done);
2442 2448
2449 if (!args->userdata)
2450 return __xfs_alloc_vextent(args);
2451
2452
2443 args->done = &done; 2453 args->done = &done;
2444 INIT_WORK(&args->work, xfs_alloc_vextent_worker); 2454 INIT_WORK_ONSTACK(&args->work, xfs_alloc_vextent_worker);
2445 queue_work(xfs_alloc_wq, &args->work); 2455 queue_work(xfs_alloc_wq, &args->work);
2446 wait_for_completion(&done); 2456 wait_for_completion(&done);
2447 return args->result; 2457 return args->result;