summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/super.c
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2017-10-19 04:05:57 +0200
committerJaegeuk Kim <jaegeuk@kernel.org>2017-10-26 10:44:21 +0200
commit57864ae5ce3ab5c6e3137dd03edefdb2e5531ba1 (patch)
tree759d8b6d20e4c1eae6ea718708288ba484b0e778 /fs/f2fs/super.c
parentf2fs: update ctx->pos correctly when hitting hole in directory (diff)
downloadlinux-57864ae5ce3ab5c6e3137dd03edefdb2e5531ba1.tar.xz
linux-57864ae5ce3ab5c6e3137dd03edefdb2e5531ba1.zip
f2fs: limit # of inmemory pages
If some abnormal users try lots of atomic write operations, f2fs is able to produce pinned pages in the main memory which affects system performance. This patch limits that as 20% over total memory size, and if f2fs reaches to the limit, it will drop all the inmemory pages. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to '')
-rw-r--r--fs/f2fs/super.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index dce5c4e48e23..21e524ecdb1d 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -625,6 +625,7 @@ static struct inode *f2fs_alloc_inode(struct super_block *sb)
init_rwsem(&fi->i_sem);
INIT_LIST_HEAD(&fi->dirty_list);
INIT_LIST_HEAD(&fi->gdirty_list);
+ INIT_LIST_HEAD(&fi->inmem_ilist);
INIT_LIST_HEAD(&fi->inmem_pages);
mutex_init(&fi->inmem_lock);
init_rwsem(&fi->dio_rwsem[READ]);