Commit 448d640b authored by Chris Mason's avatar Chris Mason

Btrfs: Fine tune the btree writeback exclusion some more

Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
parent 8790bad7
...@@ -214,6 +214,10 @@ static int btree_writepages(struct address_space *mapping, ...@@ -214,6 +214,10 @@ static int btree_writepages(struct address_space *mapping,
u64 num_dirty; u64 num_dirty;
u64 start = 0; u64 start = 0;
unsigned long thresh = 96 * 1024 * 1024; unsigned long thresh = 96 * 1024 * 1024;
if (wbc->for_kupdate)
return 0;
num_dirty = count_range_bits(tree, &start, thresh, EXTENT_DIRTY); num_dirty = count_range_bits(tree, &start, thresh, EXTENT_DIRTY);
if (num_dirty < thresh) { if (num_dirty < thresh) {
return 0; return 0;
......
...@@ -767,7 +767,8 @@ static ssize_t btrfs_file_write(struct file *file, const char __user *buf, ...@@ -767,7 +767,8 @@ static ssize_t btrfs_file_write(struct file *file, const char __user *buf,
num_written += write_bytes; num_written += write_bytes;
balance_dirty_pages_ratelimited_nr(inode->i_mapping, num_pages); balance_dirty_pages_ratelimited_nr(inode->i_mapping, num_pages);
btrfs_btree_balance_dirty(root, 1); if (num_pages < (root->leafsize >> PAGE_CACHE_SHIFT) + 1)
btrfs_btree_balance_dirty(root, 1);
cond_resched(); cond_resched();
} }
mutex_unlock(&inode->i_mutex); mutex_unlock(&inode->i_mutex);
......
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