Skip to content

Commit

Permalink
Btrfs: unplug every once and a while
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Chris Mason committed Dec 15, 2011
1 parent 567a45e commit d85c8a6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions fs/btrfs/volumes.c
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,12 @@ static noinline int run_scheduled_bios(struct btrfs_device *device)
btrfs_requeue_work(&device->work);
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();
Expand Down

0 comments on commit d85c8a6

Please sign in to comment.