Browse Source

btrfs: add cond_resched to btrfs_qgroup_trace_leaf_items

On an uncontended system, we can end up hitting soft lockups while
doing replace_path.  At the core, and frequently called is
btrfs_qgroup_trace_leaf_items, so it makes sense to add a cond_resched
there.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Jeff Mahoney 8 years ago
parent
commit
cddf3b2cb3
1 changed files with 1 additions and 0 deletions
  1. 1 0
      fs/btrfs/qgroup.c

+ 1 - 0
fs/btrfs/qgroup.c

@@ -1559,6 +1559,7 @@ int btrfs_qgroup_trace_leaf_items(struct btrfs_trans_handle *trans,
 		if (ret)
 			return ret;
 	}
+	cond_resched();
 	return 0;
 }