summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/disk-io.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2009-03-13 15:17:05 +0100
committerChris Mason <chris.mason@oracle.com>2009-03-24 21:14:26 +0100
commitc3e69d58e86c3917ae4e9e31b4acf490a7cafe60 (patch)
treebd4f1e62446a208bdae26f0c36d67e3afbc1cd1d /fs/btrfs/disk-io.c
parentBtrfs: try to cleanup delayed refs while freeing extents (diff)
downloadlinux-c3e69d58e86c3917ae4e9e31b4acf490a7cafe60.tar.xz
linux-c3e69d58e86c3917ae4e9e31b4acf490a7cafe60.zip
Btrfs: process the delayed reference queue in clusters
The delayed reference queue maintains pending operations that need to be done to the extent allocation tree. These are processed by finding records in the tree that are not currently being processed one at a time. This is slow because it uses lots of time searching through the rbtree and because it creates lock contention on the extent allocation tree when lots of different procs are running delayed refs at the same time. This commit changes things to grab a cluster of refs for processing, using a cursor into the rbtree as the starting point of the next search. This way we walk smoothly through the rbtree. Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r--fs/btrfs/disk-io.c17
1 files changed, 0 insertions, 17 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 4f43e227a297..1f1d89b18818 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -1458,7 +1458,6 @@ static int transaction_kthread(void *arg)
struct btrfs_root *root = arg;
struct btrfs_trans_handle *trans;
struct btrfs_transaction *cur;
- struct btrfs_fs_info *info = root->fs_info;
unsigned long now;
unsigned long delay;
int ret;
@@ -1481,24 +1480,8 @@ static int transaction_kthread(void *arg)
now = get_seconds();
if (now < cur->start_time || now - cur->start_time < 30) {
- unsigned long num_delayed;
- num_delayed = cur->delayed_refs.num_entries;
mutex_unlock(&root->fs_info->trans_mutex);
delay = HZ * 5;
-
- /*
- * we may have been woken up early to start
- * processing the delayed extent ref updates
- * If so, run some of them and then loop around again
- * to see if we need to force a commit
- */
- if (num_delayed > 64) {
- mutex_unlock(&info->transaction_kthread_mutex);
- trans = btrfs_start_transaction(root, 1);
- btrfs_run_delayed_refs(trans, root, 256);
- btrfs_end_transaction(trans, root);
- continue;
- }
goto sleep;
}
mutex_unlock(&root->fs_info->trans_mutex);