Commit d85c8a6f authored by Chris Mason's avatar Chris Mason

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: default avatarChris Mason <chris.mason@oracle.com>
parent 567a45e9
...@@ -295,6 +295,12 @@ static noinline int run_scheduled_bios(struct btrfs_device *device) ...@@ -295,6 +295,12 @@ static noinline int run_scheduled_bios(struct btrfs_device *device)
btrfs_requeue_work(&device->work); btrfs_requeue_work(&device->work);
goto done; goto done;
} }
/* unplug every 64 requests just for good measure */
if (batch_run % 64 == 0) {
blk_finish_plug(&plug);
blk_start_plug(&plug);
sync_pending = 0;
}
} }
cond_resched(); cond_resched();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment