mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
Btrfs: Limit btree writeback to prevent seeks
Signed-off-by: Chris Mason <chris.mason@oracle.com>
This commit is contained in:
parent
015a739c7c
commit
793955bca6
3 changed files with 51 additions and 0 deletions
|
@ -210,6 +210,15 @@ static int btree_writepages(struct address_space *mapping,
|
|||
{
|
||||
struct extent_map_tree *tree;
|
||||
tree = &BTRFS_I(mapping->host)->extent_tree;
|
||||
if (wbc->sync_mode == WB_SYNC_NONE) {
|
||||
u64 num_dirty;
|
||||
u64 start = 0;
|
||||
unsigned long thresh = 96 * 1024 * 1024;
|
||||
num_dirty = count_range_bits(tree, &start, thresh, EXTENT_DIRTY);
|
||||
if (num_dirty < thresh) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return extent_writepages(tree, mapping, btree_get_extent, wbc);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue