[PATCH 6/6] vfs: Avoid unnecessary WB_SYNC_NONE writeback during sys_sync and reorder sync passes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



wakeup_flusher_threads(0) will queue work doing complete writeback for each
flusher thread. Thus there is not much point in submitting another work doing
full inode WB_SYNC_NONE writeback by writeback_inodes_sb().

After this change it does not make sense to call nonblocking ->sync_fs and
block device flush before calling sync_inodes_sb() because
wakeup_flusher_threads() is completely asynchronous and thus these functions
would be called in parallel with inode writeback running which will effectively
void any work they do. So we move sync_inodes_sb() call before these two
functions.

Signed-off-by: Jan Kara <jack@xxxxxxx>
---
 fs/sync.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/fs/sync.c b/fs/sync.c
index 7c55c5d..02ba2a5 100644
--- a/fs/sync.c
+++ b/fs/sync.c
@@ -133,10 +133,9 @@ SYSCALL_DEFINE0(sync)
 	int nowait = 0, wait = 1;
 
 	wakeup_flusher_threads(0);
-	iterate_supers(sync_inodes_one_sb, &nowait);
+	iterate_supers(sync_inodes_one_sb, &wait);
 	iterate_supers(sync_fs_one_sb, &nowait);
 	sync_all_bdevs(nowait);
-	iterate_supers(sync_inodes_one_sb, &wait);
 	iterate_supers(sync_fs_one_sb, &wait);
 	sync_all_bdevs(wait);
 	if (unlikely(laptop_mode))
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux