]> git.hungrycats.org Git - linux/commit
fs-writeback: unplug before cond_resched in writeback_sb_inodes
authorChris Mason <clm@fb.com>
Fri, 18 Sep 2015 17:35:08 +0000 (13:35 -0400)
committerSasha Levin <sasha.levin@oracle.com>
Fri, 4 Mar 2016 15:19:42 +0000 (10:19 -0500)
commit3fb0c4b7ca3edc0e2404174a01e1af52c23d7401
tree96de2dbf02fd43632508053a2c869b1a2042b95d
parent2bc4fc8104b15fc237204165d5c35f9bb069680a
fs-writeback: unplug before cond_resched in writeback_sb_inodes

[ Upstream commit 590dca3a71875461e8fea3013af74386945191b2 ]

Commit 505a666ee3fc ("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/570

Signed-off-by: Chris Mason <clm@fb.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
fs/fs-writeback.c