aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/volumes.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2008-08-28 06:15:24 -0400
committerChris Mason <chris.mason@oracle.com>2008-09-25 11:04:07 -0400
commit9473f16c75606fe6b2e5000525fe9766114505f3 (patch)
tree93080f8a9bcf59170ce9b56b7e8b03fb4bfed8d9 /fs/btrfs/volumes.c
parentf3f9931e3d0836509cfccdf473b34e34543a3272 (diff)
Btrfs: Throttle for async bio submits higher up the chain
The current code waits for the count of async bio submits to get below a given threshold if it is too high right after adding the latest bio to the work queue. This isn't optimal because the caller may have sequential adjacent bios pending they are waiting to send down the pipe. This changeset requires the caller to wait on the async bio count, and changes the async checksumming submits to wait for async bios any time they self throttle. The end result is much higher sequential throughput. Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/volumes.c')
-rw-r--r--fs/btrfs/volumes.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 2652660e6079..5b1b60839d21 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -2145,7 +2145,6 @@ int schedule_bio(struct btrfs_root *root, struct btrfs_device *device,
2145 int rw, struct bio *bio) 2145 int rw, struct bio *bio)
2146{ 2146{
2147 int should_queue = 1; 2147 int should_queue = 1;
2148 unsigned long limit;
2149 2148
2150 /* don't bother with additional async steps for reads, right now */ 2149 /* don't bother with additional async steps for reads, right now */
2151 if (!(rw & (1 << BIO_RW))) { 2150 if (!(rw & (1 << BIO_RW))) {
@@ -2182,11 +2181,6 @@ int schedule_bio(struct btrfs_root *root, struct btrfs_device *device,
2182 if (should_queue) 2181 if (should_queue)
2183 btrfs_queue_worker(&root->fs_info->submit_workers, 2182 btrfs_queue_worker(&root->fs_info->submit_workers,
2184 &device->work); 2183 &device->work);
2185
2186 limit = btrfs_async_submit_limit(root->fs_info);
2187 wait_event_timeout(root->fs_info->async_submit_wait,
2188 (atomic_read(&root->fs_info->nr_async_bios) < limit),
2189 HZ/10);
2190 return 0; 2184 return 0;
2191} 2185}
2192 2186