From: Peng Wu wupeng58@huawei.com
hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I4SK3S CVE: NA
----------------------------------------------------
Reliable memory used shown in /proc/pid/status is incorrect because this var is about page count. So (PAGE_SHIFT - 10) is multiplied to get correct size in kB.
Fixes: 094eaabb3fe8 ("proc: Count reliable memory usage of reliable tasks") Signed-off-by: Peng Wu wupeng58@huawei.com Reviewed-by: Kefeng Wangwangkefeng.wang@huawei.com Signed-off-by: Yang Yingliang yangyingliang@huawei.com --- mm/mem_reliable.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/mm/mem_reliable.c b/mm/mem_reliable.c index dcbe3f58f6927..01b0af708bc63 100644 --- a/mm/mem_reliable.c +++ b/mm/mem_reliable.c @@ -211,10 +211,11 @@ void reliable_report_meminfo(struct seq_file *m)
void reliable_report_usage(struct seq_file *m, struct mm_struct *mm) { - if (mem_reliable_is_enabled()) { - seq_printf(m, "Reliable:\t%8lu kB\n", - atomic_long_read(&mm->reliable_nr_page)); - } + if (!mem_reliable_is_enabled()) + return; + + seq_printf(m, "Reliable:\t%8lu kB\n", + atomic_long_read(&mm->reliable_nr_page) << (PAGE_SHIFT - 10)); }
#ifdef CONFIG_SYSCTL