aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosef Bacik <jbacik@fb.com>2014-12-18 11:34:23 -0500
committerJosef Bacik <jbacik@fb.com>2014-12-19 10:32:25 -0500
commit29249e14d6e3379a5c4bb098dd4beddfefbc606f (patch)
tree0bc1dc11ff138713cf0b7d8742693065dd46934e
parent2dbfca5a181973558277b28b1f4c36362291f5e0 (diff)
downloadbtrfs-next-29249e14d6e3379a5c4bb098dd4beddfefbc606f.tar.gz
fs: don't softlockup when evicting inodes
If I run an fs_mark job that creates millions of empty files and then immediately unmount the file system I will get a softlockup during unmount. This box has ~140gb of RAM so we never hit sufficient memory pressure to evict enough inodes during the runtime of the benchmark, which means I see around 80 million inodes being evicted at unmount time. With this patch my box no longer softlocks up. Thanks, Signed-off-by: Josef Bacik <jbacik@fb.com>
-rw-r--r--fs/inode.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/inode.c b/fs/inode.c
index ad60555b4768..f26676567485 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -581,6 +581,7 @@ static void dispose_list(struct list_head *head)
list_del_init(&inode->i_lru);
evict(inode);
+ cond_resched();
}
}
@@ -613,6 +614,7 @@ void evict_inodes(struct super_block *sb)
inode_lru_list_del(inode);
spin_unlock(&inode->i_lock);
list_add(&inode->i_lru, &dispose);
+ cond_resched_lock(&inode_sb_list_lock);
}
spin_unlock(&inode_sb_list_lock);