diff options
Diffstat (limited to 'fs/btrfs/extent-tree.c')
-rw-r--r-- | fs/btrfs/extent-tree.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 32d094002a57..c6a5d9095d5f 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c | |||
@@ -3115,6 +3115,7 @@ static int shrink_delalloc(struct btrfs_trans_handle *trans, | |||
3115 | u64 reserved; | 3115 | u64 reserved; |
3116 | u64 max_reclaim; | 3116 | u64 max_reclaim; |
3117 | u64 reclaimed = 0; | 3117 | u64 reclaimed = 0; |
3118 | int no_reclaim = 0; | ||
3118 | int pause = 1; | 3119 | int pause = 1; |
3119 | int ret; | 3120 | int ret; |
3120 | 3121 | ||
@@ -3131,12 +3132,16 @@ static int shrink_delalloc(struct btrfs_trans_handle *trans, | |||
3131 | while (1) { | 3132 | while (1) { |
3132 | ret = btrfs_start_one_delalloc_inode(root, trans ? 1 : 0); | 3133 | ret = btrfs_start_one_delalloc_inode(root, trans ? 1 : 0); |
3133 | if (!ret) { | 3134 | if (!ret) { |
3135 | if (no_reclaim > 2) | ||
3136 | break; | ||
3137 | no_reclaim++; | ||
3134 | __set_current_state(TASK_INTERRUPTIBLE); | 3138 | __set_current_state(TASK_INTERRUPTIBLE); |
3135 | schedule_timeout(pause); | 3139 | schedule_timeout(pause); |
3136 | pause <<= 1; | 3140 | pause <<= 1; |
3137 | if (pause > HZ / 10) | 3141 | if (pause > HZ / 10) |
3138 | pause = HZ / 10; | 3142 | pause = HZ / 10; |
3139 | } else { | 3143 | } else { |
3144 | no_reclaim = 0; | ||
3140 | pause = 1; | 3145 | pause = 1; |
3141 | } | 3146 | } |
3142 | 3147 | ||