aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2008-08-15 03:40:43 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-08-15 11:35:44 -0400
commit7d455e0030eeab820773e7786605be4d9e56a04b (patch)
treea388a21fac6ab04e75fb7a722a6abd095ab997a1 /fs
parent75312619e8cd47265da210189cca57ab09640b18 (diff)
fs/inode.c: properly init address_space->writeback_index
write_cache_pages() uses i_mapping->writeback_index to pick up where it left off the last time a given inode was found by pdflush or balance_dirty_pages (or anyone else who sets wbc->range_cyclic) alloc_inode() should set it to a sane value so that writeback doesn't start in the middle of a file. It is somewhat difficult to notice the bug since write_cache_pages will loop around to the start of the file and the elevator helps hide the resulting seeks. For whatever reason, Btrfs hits this often. Unpatched, untarring 30 copies of the linux kernel in series runs at 47MB/s on a single sata drive. With this fix, it jumps to 62MB/s. Signed-off-by: Chris Mason <chris.mason@oracle.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/inode.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/inode.c b/fs/inode.c
index b6726f644530..0487ddba1397 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -166,6 +166,7 @@ static struct inode *alloc_inode(struct super_block *sb)
166 mapping_set_gfp_mask(mapping, GFP_HIGHUSER_PAGECACHE); 166 mapping_set_gfp_mask(mapping, GFP_HIGHUSER_PAGECACHE);
167 mapping->assoc_mapping = NULL; 167 mapping->assoc_mapping = NULL;
168 mapping->backing_dev_info = &default_backing_dev_info; 168 mapping->backing_dev_info = &default_backing_dev_info;
169 mapping->writeback_index = 0;
169 170
170 /* 171 /*
171 * If the block_device provides a backing_dev_info for client 172 * If the block_device provides a backing_dev_info for client