From: Tang Yizhou tangyizhou@huawei.com
ascend inclusion category: bugfix bugzilla: 46906 CVE: NA
-------------------------------------------------
When CONFIG_MEMCG is disabled an CONFIG_MM_OWNER is enabled, we encounter a compilation error as follows:
kernel/exit.c:399:6: error: redefinition of ‘mm_update_next_owner’ void mm_update_next_owner(struct mm_struct *mm) ^~~~~~~~~~~~~~~~~~~~ In file included from kernel/exit.c:10:0: ./include/linux/sched/mm.h:128:20: note: previous definition of ‘mm_update_next_owner’ was here static inline void mm_update_next_owner(struct mm_struct *mm)
To fix it, let mm_update_next_owner() depend on CONFIG_MM_OWNER
Fixes: 7560b5eec37c ("ascend: mm: add an owner for mm_struct") Signed-off-by: Tang Yizhou tangyizhou@huawei.com Reviewed-by: Kefeng Wang wangkefeng.wang@huawei.com Reviewed-by: Ding Tianhong dingtianhong@huawei.com Signed-off-by: Yang Yingliang yangyingliang@huawei.com --- include/linux/sched/mm.h | 2 +- mm/Kconfig | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/linux/sched/mm.h b/include/linux/sched/mm.h index 9457e8dd06c6..1f7224d3483c 100644 --- a/include/linux/sched/mm.h +++ b/include/linux/sched/mm.h @@ -122,7 +122,7 @@ extern struct mm_struct *mm_access(struct task_struct *task, unsigned int mode); /* Remove the current tasks stale references to the old mm_struct */ extern void mm_release(struct task_struct *, struct mm_struct *);
-#ifdef CONFIG_MEMCG +#ifdef CONFIG_MM_OWNER extern void mm_update_next_owner(struct mm_struct *mm); #else static inline void mm_update_next_owner(struct mm_struct *mm) diff --git a/mm/Kconfig b/mm/Kconfig index 76c2197a3f99..1deeb1b3b9f7 100644 --- a/mm/Kconfig +++ b/mm/Kconfig @@ -302,7 +302,7 @@ config VIRT_TO_BUS config MM_OWNER bool "Enable the ownership the mm owner" help - This option enables mm_struct's to have an owner. + This option allows to record the canonical user of an mm struct
config MMU_NOTIFIER bool