Commit 45bd608e authored by Ma Wupeng's avatar Ma Wupeng Committed by Yang Yingliang
Browse files

mm: Introduce watermark check for memory reliable

hulk inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I4SK3S


CVE: NA

----------------------------------------------

Introuce min watermark to ensure kernel can use this reserved memory.
This watermark will prevent special user tasks, pagecache, tmpfs user from
using too many mirrored memory which will lead to kernel oom.

Memory allocation with ___GFP_RELIABILITY or special user tasks will be
blocked after this watermark is reached. This memory allocation will
fallback to non-mirrored region or trigger oom depends on memory reliable
fallback's status.

This limit can be set or access via /proc/sys/vm/reliable_reserve_size.
The default value of this limit is 256M. This limit can be set from 256M to
the total size of mirrored memory.

Signed-off-by: default avatarMa Wupeng <mawupeng1@huawei.com>
Reviewed-by: default avatarXie XiuQi <xiexiuqi@huawei.com>
Reviewed-by: default avatarKefeng <Wang&lt;wangkefeng.wang@huawei.com>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
parent ee97b610
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment