Commit Graph

3 Commits

Author SHA1 Message Date
Xin Hao de6b458f94 anolis: mm: pagecache_limit: add memcg asynchronous reclaim support
ANBZ: #3907

This patch add memcg pagecache limit asynchronous reclaim support, since
pagecache limit asynchronous reclaim is scheduled by workqueue, it could
do more work than synchronous reclaim, i.e. write out dirty page, etc,
and in order to minimize the performance jitter when dirty pages to be
reclaimed, we only enable dirty pages to be reclaimed when priority value
is smaller than DEF_PRIORITY - 2, and the reclaim must be in asynchronous
scenario.

Signed-off-by: Xin Hao <xhao@linux.alibaba.com>
Reviewed-by: Xu Yu <xuyu@linux.alibaba.com>
Reviewed-by: Rongwei Wang <rongwei.wang@linux.alibaba.com>
Reviewed-by: Kaihao Bai <carlo.bai@linux.alibaba.com>
Link: https://gitee.com/anolis/cloud-kernel/pulls/1157
2023-02-17 06:28:42 +00:00
Xin Hao f5b3f97e84 anolis: mm: pagecache_limit: add memcg synchronous reclaim support
ANBZ: #3907

This patch is used to support memcg synchronous reclaim,
it includes hierarchical attributes, it will also reclaim
its sublevels memcg pagecache also, we do some optimizations
to avoid large fluctuations in the direct reclaim path, for
example, we only allow the mapped pages to be reclaimed
when priority value is smaller than DEF_PRIORITY - 4.

Signed-off-by: Xin Hao <xhao@linux.alibaba.com>
Reviewed-by: Xu Yu <xuyu@linux.alibaba.com>
Reviewed-by: Rongwei Wang <rongwei.wang@linux.alibaba.com>
Reviewed-by: Kaihao Bai <carlo.bai@linux.alibaba.com>
Link: https://gitee.com/anolis/cloud-kernel/pulls/1157
2023-02-17 06:28:42 +00:00
Xin Hao 8bb9793aab anolis: mm: pagecache_limit: add this feature support
ANBZ: #3907

The "pagecache limit" feature is used to solve the problem that the
system has large number memory of pagecache, which may cause
insufficient remaining memory in the system, and, service performance
and usage are affected, therefore, in some scenarios, you need to limit
the pagecache usage to ensure that the remaining memory can meet service
requirements.

There we just add some basic interfaces for us to optionally enable or
disable the "pagecache_limit" function.

Signed-off-by: Xin Hao <xhao@linux.alibaba.com>
Reviewed-by: Xu Yu <xuyu@linux.alibaba.com>
Reviewed-by: Rongwei Wang <rongwei.wang@linux.alibaba.com>
Reviewed-by: Kaihao Bai <carlo.bai@linux.alibaba.com>
Link: https://gitee.com/anolis/cloud-kernel/pulls/1157
2023-02-17 06:28:42 +00:00