From: Jan Kara Date: Wed, 11 Sep 2013 21:22:22 +0000 (-0700) Subject: writeback: fix occasional slow sync(1) X-Git-Tag: v3.12-rc1~52^2~195 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=47df3ddedd22c3f8e68aff831edb7921937674a2;p=pandora-kernel.git writeback: fix occasional slow sync(1) In case when system contains no dirty pages, wakeup_flusher_threads() will submit WB_SYNC_NONE writeback for 0 pages so wb_writeback() exits immediately without doing anything, even though there are dirty inodes in the system. Thus sync(1) will write all the dirty inodes from a WB_SYNC_ALL writeback pass which is slow. Fix the problem by using get_nr_dirty_pages() in wakeup_flusher_threads() instead of calculating number of dirty pages manually. That function also takes number of dirty inodes into account. Signed-off-by: Jan Kara Reported-by: Paul Taysom Cc: Wu Fengguang Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed