OSDN Git Service

f2fs: allow to change discard policy based on cached discard cmds
authorSahitya Tummala <stummala@codeaurora.org>
Tue, 16 Mar 2021 09:29:18 +0000 (14:59 +0530)
committerJaegeuk Kim <jaegeuk@kernel.org>
Fri, 26 Mar 2021 17:27:44 +0000 (10:27 -0700)
commitd6d2b491a82e1e411a6766fbfb87c697d8701554
treea845211793358143ef3e744190cf76545c33e0e8
parent61461fc921b756ae16e64243f72af2bfc2e620db
f2fs: allow to change discard policy based on cached discard cmds

With the default DPOLICY_BG discard thread is ioaware, which prevents
the discard thread from issuing the discard commands. On low RAM setups,
it is observed that these discard commands in the cache are consuming
high memory. This patch aims to relax the memory pressure on the system
due to f2fs pending discard cmds by changing the policy to DPOLICY_FORCE
based on the nm_i->ram_thresh configured.

Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/node.c
fs/f2fs/node.h
fs/f2fs/segment.c