• Chris Mason's avatar
    fs-writeback: unplug before cond_resched in writeback_sb_inodes · 590dca3a
    Chris Mason authored
    Commit 505a666e ("writeback: plug writeback in wb_writeback() and
    writeback_inodes_wb()") has us holding a plug during writeback_sb_inodes,
    which increases the merge rate when relatively contiguous small files
    are written by the filesystem.  It helps both on flash and spindles.
    
    For an fs_mark workload creating 4K files in parallel across 8 drives,
    this commit improves performance ~9% more by unplugging before calling
    cond_resched().  cond_resched() doesn't trigger an implicit unplug, so
    explicitly getting the IO down to the device before scheduling reduces
    latencies for anyone waiting on clean pages.
    
    It also cuts down on how often we use kblockd to unplug, which means
    less work bouncing from one workqueue to another.
    
    Many more details about how we got here:
    
      https://lkml.org/lkml/2015/9/11/570Signed-off-by: default avatarChris Mason <clm@fb.com>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    590dca3a
fs-writeback.c 66.9 KB