
From: Ma Wupeng <mawupeng1@huawei.com> hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I4SK3S CVE: NA -------------------------------- Introduce reliable_debug=S to control shmem use mirrored memory. Signed-off-by: Ma Wupeng <mawupeng1@huawei.com> Reviewed-by: Kefeng Wang <wangkefeng.wang@huawei.com> --- Documentation/admin-guide/kernel-parameters.txt | 3 ++- mm/mem_reliable.c | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index 0a04345592ca..1e5c7a3af937 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -4778,11 +4778,12 @@ See Documentation/admin-guide/cgroup-v1/cpusets.rst. reliable_debug= [ARM64] - Format: [F][,P] + Format: [F][,S][,P] Only works with CONFIG_MEMORY_RELIABLE and "kernelcore=reliable" is configured. F: User memory allocation(special user task, tmpfs) will not allocate memory from non-mirrored region if failed. + S: The shmem does not use the reliable memory. P: Page cache does not use the reliable memory. reserve= [KNL,BUGS] Force kernel to ignore I/O ports or memory diff --git a/mm/mem_reliable.c b/mm/mem_reliable.c index 6c2c4583cb2e..2322bd4e73a0 100644 --- a/mm/mem_reliable.c +++ b/mm/mem_reliable.c @@ -342,6 +342,10 @@ static int __init setup_reliable_debug(char *str) reliable_allow_fallback = false; pr_info("disable memory reliable fallback\n"); break; + case 'S': + shmem_reliable = false; + pr_info("disable shmem use reliable memory\n"); + break; case 'P': pagecache_use_reliable_mem = false; pr_info("disable page cache use reliable memory\n"); -- 2.20.1