aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/btrfs/volumes.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 9d3618192009..27d5f37b845f 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -161,6 +161,7 @@ static noinline int run_scheduled_bios(struct btrfs_device *device)
161 int again = 0; 161 int again = 0;
162 unsigned long num_run; 162 unsigned long num_run;
163 unsigned long num_sync_run; 163 unsigned long num_sync_run;
164 unsigned long batch_run = 0;
164 unsigned long limit; 165 unsigned long limit;
165 unsigned long last_waited = 0; 166 unsigned long last_waited = 0;
166 int force_reg = 0; 167 int force_reg = 0;
@@ -257,6 +258,8 @@ loop_lock:
257 BUG_ON(atomic_read(&cur->bi_cnt) == 0); 258 BUG_ON(atomic_read(&cur->bi_cnt) == 0);
258 submit_bio(cur->bi_rw, cur); 259 submit_bio(cur->bi_rw, cur);
259 num_run++; 260 num_run++;
261 batch_run++;
262
260 if (bio_sync(cur)) 263 if (bio_sync(cur))
261 num_sync_run++; 264 num_sync_run++;
262 265
@@ -273,7 +276,7 @@ loop_lock:
273 * is now congested. Back off and let other work structs 276 * is now congested. Back off and let other work structs
274 * run instead 277 * run instead
275 */ 278 */
276 if (pending && bdi_write_congested(bdi) && num_run > 16 && 279 if (pending && bdi_write_congested(bdi) && batch_run > 32 &&
277 fs_info->fs_devices->open_devices > 1) { 280 fs_info->fs_devices->open_devices > 1) {
278 struct io_context *ioc; 281 struct io_context *ioc;
279 282