f2fs: fix a hungtask problem caused by congestion_wait
authorYunlei He <heyunlei@huawei.com>
Thu, 21 Jun 2018 06:49:06 +0000 (14:49 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Wed, 5 Sep 2018 22:08:31 +0000 (15:08 -0700)
commit4af3211804f8ccbfd1612523a3f1a1992b4592ed
treea3c3106a6db7096f62828f44c0b3ff26cfc49a7d
parent2c077ed3d901d6ed3e468639fd16ef911a250003
f2fs: fix a hungtask problem caused by congestion_wait

This patch fix hungtask problem which can be reproduced as follow:

Thread 0~3:
while true
do
        touch /xxx/test/file_xxx
done

Thread 4 write a new checkpoint every three seconds.

In the meantime, fio start 16 threads for randwrite.

With my debug info, cycles num will exceed 1000 in function
f2fs_sync_dirty_inodes, and most of cycle will be dropped
into congestion_wait() and sleep more than 20ms. Cycles num
reduced to 3 with this patch.

Signed-off-by: Yunlei He <heyunlei@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/checkpoint.c