Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 128874
b: refs/heads/master
c: 18e35e0
h: refs/heads/master
v: v3
  • Loading branch information
Chris Mason committed Sep 25, 2008
1 parent c27da3f commit e9d593c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f87f057b49ee52cf5c627ab27a706e3252767c9f
refs/heads/master: 18e35e0ab337ec99c7e03e9ae917745a352c0bb1
7 changes: 5 additions & 2 deletions trunk/fs/btrfs/extent-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -2535,6 +2535,10 @@ static int noinline walk_down_tree(struct btrfs_trans_handle *trans,
root_gen, 0, 0, 1);
BUG_ON(ret);
mutex_unlock(&root->fs_info->alloc_mutex);

atomic_inc(&root->fs_info->throttle_gen);
wake_up(&root->fs_info->transaction_throttle);

continue;
}
/*
Expand Down Expand Up @@ -2603,7 +2607,6 @@ static int noinline walk_down_tree(struct btrfs_trans_handle *trans,
root_owner = btrfs_header_owner(parent);
root_gen = btrfs_header_generation(parent);


mutex_lock(&root->fs_info->alloc_mutex);
ret = __btrfs_free_extent(trans, root, bytenr, blocksize,
root_owner, root_gen, 0, 0, 1);
Expand Down Expand Up @@ -2726,7 +2729,6 @@ int btrfs_drop_snapshot(struct btrfs_trans_handle *trans, struct btrfs_root
}
}
while(1) {
atomic_inc(&root->fs_info->throttle_gen);
wret = walk_down_tree(trans, root, path, &level);
if (wret > 0)
break;
Expand All @@ -2742,6 +2744,7 @@ int btrfs_drop_snapshot(struct btrfs_trans_handle *trans, struct btrfs_root
ret = -EAGAIN;
break;
}
atomic_inc(&root->fs_info->throttle_gen);
wake_up(&root->fs_info->transaction_throttle);
}
for (i = 0; i <= orig_level; i++) {
Expand Down
14 changes: 0 additions & 14 deletions trunk/fs/btrfs/transaction.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,11 +211,9 @@ static void throttle_on_drops(struct btrfs_root *root)
{
struct btrfs_fs_info *info = root->fs_info;

harder:
if (atomic_read(&info->throttles)) {
DEFINE_WAIT(wait);
int thr;
int harder_count = 0;
thr = atomic_read(&info->throttle_gen);

do {
Expand All @@ -228,18 +226,6 @@ static void throttle_on_drops(struct btrfs_root *root)
schedule();
finish_wait(&info->transaction_throttle, &wait);
} while (thr == atomic_read(&info->throttle_gen));

if (harder_count < 5 &&
info->total_ref_cache_size > 1 * 1024 * 1024) {
harder_count++;
goto harder;
}

if (harder_count < 10 &&
info->total_ref_cache_size > 5 * 1024 * 1024) {
harder_count++;
goto harder;
}
}
}

Expand Down

0 comments on commit e9d593c

Please sign in to comment.