diff options
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r-- | fs/btrfs/disk-io.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 9902d29abd06..9601b13c7d7a 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c | |||
@@ -429,7 +429,7 @@ int btrfs_bio_wq_end_io(struct btrfs_fs_info *info, struct bio *bio, | |||
429 | return 0; | 429 | return 0; |
430 | } | 430 | } |
431 | 431 | ||
432 | static int congested_async(struct btrfs_fs_info *info, int iodone) | 432 | int btrfs_congested_async(struct btrfs_fs_info *info, int iodone) |
433 | { | 433 | { |
434 | int limit = 256 * info->fs_devices->open_devices; | 434 | int limit = 256 * info->fs_devices->open_devices; |
435 | 435 | ||
@@ -438,9 +438,6 @@ static int congested_async(struct btrfs_fs_info *info, int iodone) | |||
438 | if (atomic_read(&info->nr_async_submits) > limit) | 438 | if (atomic_read(&info->nr_async_submits) > limit) |
439 | return 1; | 439 | return 1; |
440 | 440 | ||
441 | limit = 8192 * info->fs_devices->open_devices; | ||
442 | if (iodone) | ||
443 | limit = (limit * 3) / 2; | ||
444 | return atomic_read(&info->nr_async_bios) > limit; | 441 | return atomic_read(&info->nr_async_bios) > limit; |
445 | } | 442 | } |
446 | 443 | ||
@@ -454,7 +451,7 @@ static void run_one_async_submit(struct btrfs_work *work) | |||
454 | atomic_dec(&fs_info->nr_async_submits); | 451 | atomic_dec(&fs_info->nr_async_submits); |
455 | 452 | ||
456 | if ((async->bio->bi_rw & (1 << BIO_RW)) && | 453 | if ((async->bio->bi_rw & (1 << BIO_RW)) && |
457 | !congested_async(fs_info, 1)) { | 454 | !btrfs_congested_async(fs_info, 1)) { |
458 | clear_bdi_congested(&fs_info->bdi, WRITE); | 455 | clear_bdi_congested(&fs_info->bdi, WRITE); |
459 | } | 456 | } |
460 | async->submit_bio_hook(async->inode, async->rw, async->bio, | 457 | async->submit_bio_hook(async->inode, async->rw, async->bio, |
@@ -963,7 +960,7 @@ static int btrfs_congested_fn(void *congested_data, int bdi_bits) | |||
963 | struct backing_dev_info *bdi; | 960 | struct backing_dev_info *bdi; |
964 | 961 | ||
965 | if ((bdi_bits & (1 << BDI_write_congested)) && | 962 | if ((bdi_bits & (1 << BDI_write_congested)) && |
966 | congested_async(info, 0)) | 963 | btrfs_congested_async(info, 0)) |
967 | return 1; | 964 | return 1; |
968 | 965 | ||
969 | list_for_each(cur, &info->fs_devices->devices) { | 966 | list_for_each(cur, &info->fs_devices->devices) { |
@@ -1844,7 +1841,7 @@ void btrfs_btree_balance_dirty(struct btrfs_root *root, unsigned long nr) | |||
1844 | struct extent_io_tree *tree; | 1841 | struct extent_io_tree *tree; |
1845 | u64 num_dirty; | 1842 | u64 num_dirty; |
1846 | u64 start = 0; | 1843 | u64 start = 0; |
1847 | unsigned long thresh = 16 * 1024 * 1024; | 1844 | unsigned long thresh = 2 * 1024 * 1024; |
1848 | tree = &BTRFS_I(root->fs_info->btree_inode)->io_tree; | 1845 | tree = &BTRFS_I(root->fs_info->btree_inode)->io_tree; |
1849 | 1846 | ||
1850 | if (current_is_pdflush()) | 1847 | if (current_is_pdflush()) |