]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Btrfs: Raise thresholds for metadata writeback
authorChris Mason <chris.mason@oracle.com>
Wed, 24 Sep 2008 18:51:30 +0000 (14:51 -0400)
committerChris Mason <chris.mason@oracle.com>
Thu, 25 Sep 2008 19:41:59 +0000 (15:41 -0400)
Btrfs metadata writeback is fairly expensive.  Once a tree block is written
it must be cowed before it can be changed again.  The btree writepages
code has a threshold based on a count of dirty btree bytes which is
updated as IO is sent out.

This changes btree_writepages to skip the writeout if there are less
than 32MB of dirty bytes from the btrees, improving performance
across many workloads.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/disk-io.c

index dffb8dabd533b848cbaaf33028a1d1898aca189f..71e81f3a765b8c53ce901123465551d3d8ab1e99 100644 (file)
@@ -556,7 +556,7 @@ static int btree_writepages(struct address_space *mapping,
        if (wbc->sync_mode == WB_SYNC_NONE) {
                u64 num_dirty;
                u64 start = 0;
-               unsigned long thresh = 8 * 1024 * 1024;
+               unsigned long thresh = 32 * 1024 * 1024;
 
                if (wbc->for_kupdate)
                        return 0;
@@ -690,7 +690,7 @@ struct extent_buffer *btrfs_find_create_tree_block(struct btrfs_root *root,
 int btrfs_write_tree_block(struct extent_buffer *buf)
 {
        return btrfs_fdatawrite_range(buf->first_page->mapping, buf->start,
-                                     buf->start + buf->len - 1, WB_SYNC_NONE);
+                                     buf->start + buf->len - 1, WB_SYNC_ALL);
 }
 
 int btrfs_wait_tree_block_writeback(struct extent_buffer *buf)