Skip to content

Commit d85c8a6

Browse files
committed
Btrfs: unplug every once and a while
The btrfs io submission threads can build up massive plug lists. This keeps things more reasonable so we don't hand over huge dumps of IO at once. Signed-off-by: Chris Mason <chris.mason@oracle.com>
1 parent 567a45e commit d85c8a6

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎fs/btrfs/volumes.c‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,12 @@ static noinline int run_scheduled_bios(struct btrfs_device *device)
295295
btrfs_requeue_work(&device->work);
296296
goto done;
297297
}
298+
/* unplug every 64 requests just for good measure */
299+
if (batch_run % 64 == 0) {
300+
blk_finish_plug(&plug);
301+
blk_start_plug(&plug);
302+
sync_pending = 0;
303+
}
298304
}
299305

300306
cond_resched();

0 commit comments

Comments
 (0)