From 8eb421e3e9f4f6fffc4de9c45f8f378e868f7615 Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Wed, 9 Feb 2022 15:36:22 +0800 Subject: [PATCH] mm: Add reliable_nr_page for accounting reliable memory hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I4SK3S CVE: NA ------------------------------------------------- Adding an variable in mm_struct for accouting the amount of reliable memory allocated by the reliable user tasks. Use KABI_RESERVE(3) in mm_struct to avoid any kapi changes. Signed-off-by: Peng Wu Reviewed-by: Kefeng Wang Signed-off-by: Yang Yingliang --- include/linux/mm_types.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index ae4237a59d21..f2142a5eab6e 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -529,7 +529,12 @@ struct mm_struct { KABI_RESERVE(2) #endif +#if IS_ENABLED(CONFIG_MEMORY_RELIABLE) && !defined(__GENKSYMS__) + atomic_long_t reliable_nr_page; /* total used reliable pages */ +#else KABI_RESERVE(3) +#endif + KABI_RESERVE(4) KABI_RESERVE(5) KABI_RESERVE(6) -- GitLab