f2fs: avoid wait if IO end up when do_checkpoint for better performance
authorGu Zheng <guz.fnst@cn.fujitsu.com>
Mon, 14 Oct 2013 10:45:56 +0000 (18:45 +0800)
committerJaegeuk Kim <jaegeuk.kim@samsung.com>
Fri, 18 Oct 2013 00:44:14 +0000 (09:44 +0900)
Previously, do_checkpoint() will call congestion_wait() for waiting the pages
(previous submitted node/meta/data pages) to be written back.
Because congestion_wait() will set a regular period (e.g. HZ / 50 ) for waiting, and
no additional wake up mechanism was introduced if IO ends up before regular period costed.
Yuan Zhong found there is a situation that after the pages have been written back,
but the checkpoint thread still wait for congestion_wait to exit.

So here we store checkpoint task into f2fs_sb when doing checkpoint, it'll wait for IO completes
if there's IO going on, and in the end IO path, wake up checkpoint task when IO ends up.

Thanks to Yuan Zhong's pre work about this problem.

Reported-by: Yuan Zhong <yuan.mark.zhong@samsung.com>
Signed-off-by: Gu Zheng <guz.fnst@cn.fujitsu.com>
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
fs/f2fs/checkpoint.c
fs/f2fs/f2fs.h
fs/f2fs/segment.c

Simple merge
diff --cc fs/f2fs/f2fs.h
Simple merge
Simple merge