From: Ma Wupeng mawupeng1@huawei.com
hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I4SK3S CVE: NA
--------------------------------
Previous reliable_user_used was wrong if PAGE_SIZE is not 4K because this num was calculated by 4 * reliable_user_used_nr_page.
Now reliable_user_used is calculated by (PAGE_SHIFT - 10) * reliable_user_used_nr_page.
Signed-off-by: Ma Wupeng mawupeng1@huawei.com Reviewed-by: Kefeng Wangwangkefeng.wang@huawei.com Signed-off-by: Yang Yingliang yangyingliang@huawei.com --- mm/mem_reliable.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/mm/mem_reliable.c b/mm/mem_reliable.c index 01b0af708bc63..f6988f4df533d 100644 --- a/mm/mem_reliable.c +++ b/mm/mem_reliable.c @@ -514,7 +514,8 @@ void reliable_show_mem_info(void) pr_info("task_reliable_limit: %lu kB", task_reliable_limit >> 10); pr_info("reliable_user_used: %ld kB", - atomic_long_read(&reliable_user_used_nr_page) * 4); + atomic_long_read(&reliable_user_used_nr_page) << + (PAGE_SHIFT - 10)); } }