From 158ac3bb6e99f41b5e0b0cbf89799e5af4d70532 Mon Sep 17 00:00:00 2001 From: Liu Shixin Date: Wed, 7 Jun 2023 15:05:24 +0800 Subject: [PATCH] mm/dynamic_hugetlb: fix kabi broken when enable CONFIG_DYNAMIC_HUGETLB on arm64 hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I6XOIE CVE: NA -------------------------------- When enable dynamic hugetlb on arm64, the new member struct dhugetlb_pool* will be added to mem_cgroup. We need to use a KABI_RESERVE to fix broken of kabi. The previous struct dhugetlb_pool* is only used on x86_64. Signed-off-by: Liu Shixin (cherry picked from commit fc47477cc582e248a2aca841555f644a1868f2e9) --- include/linux/memcontrol.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index 5ec0c0925b14..4395f2e03cb7 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h @@ -372,7 +372,7 @@ struct mem_cgroup { struct deferred_split deferred_split_queue; #endif -#ifdef CONFIG_DYNAMIC_HUGETLB +#if defined(CONFIG_DYNAMIC_HUGETLB) && defined(CONFIG_X86_64) struct dhugetlb_pool *hpool; #endif #ifndef __GENKSYMS__ @@ -397,7 +397,11 @@ struct mem_cgroup { #else KABI_RESERVE(5) #endif +#if defined(CONFIG_DYNAMIC_HUGETLB) && defined(CONFIG_ARM64) + KABI_USE(6, struct dhugetlb_pool *hpool) +#else KABI_RESERVE(6) +#endif KABI_RESERVE(7) KABI_RESERVE(8) -- GitLab