• C
    fs/inode.c: properly init address_space->writeback_index · 7d455e00
    Chris Mason 提交于
    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: NChris Mason <chris.mason@oracle.com>
    Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
    7d455e00
inode.c 37.7 KB