summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2017-07-14 14:45:21 -0400
committerJaegeuk Kim <jaegeuk@kernel.org>2017-07-17 22:23:18 -0400
commit4db08d016ccedb5b97869724a096990acad59685 (patch)
treeefa6e133e0a0f181fd36118b8aad1bd0b37dc58c /fs
parent299aa41a45fe21977532fbf992e4f7c5eef73bf0 (diff)
f2fs: avoid cpu lockup
Before retrying to flush data or dentry pages, we need to release cpu in order to prevent watchdog. Reviewed-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/f2fs/checkpoint.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
index 56bbf592e487..5b876f6d3f6b 100644
--- a/fs/f2fs/checkpoint.c
+++ b/fs/f2fs/checkpoint.c
@@ -879,6 +879,7 @@ int sync_dirty_inodes(struct f2fs_sb_info *sbi, enum inode_type type)
879 struct inode *inode; 879 struct inode *inode;
880 struct f2fs_inode_info *fi; 880 struct f2fs_inode_info *fi;
881 bool is_dir = (type == DIR_INODE); 881 bool is_dir = (type == DIR_INODE);
882 unsigned long ino = 0;
882 883
883 trace_f2fs_sync_dirty_inodes_enter(sbi->sb, is_dir, 884 trace_f2fs_sync_dirty_inodes_enter(sbi->sb, is_dir,
884 get_pages(sbi, is_dir ? 885 get_pages(sbi, is_dir ?
@@ -901,8 +902,17 @@ retry:
901 inode = igrab(&fi->vfs_inode); 902 inode = igrab(&fi->vfs_inode);
902 spin_unlock(&sbi->inode_lock[type]); 903 spin_unlock(&sbi->inode_lock[type]);
903 if (inode) { 904 if (inode) {
905 unsigned long cur_ino = inode->i_ino;
906
904 filemap_fdatawrite(inode->i_mapping); 907 filemap_fdatawrite(inode->i_mapping);
905 iput(inode); 908 iput(inode);
909 /* We need to give cpu to another writers. */
910 if (ino == cur_ino) {
911 congestion_wait(BLK_RW_ASYNC, HZ/50);
912 cond_resched();
913 } else {
914 ino = cur_ino;
915 }
906 } else { 916 } else {
907 /* 917 /*
908 * We should submit bio, since it exists several 918 * We should submit bio, since it exists several