hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I8YMGX CVE: NA
--------------------------------
The ksm_process_profit() was only used by procfs before, so it is built under CONFIG_PROC_FS. Now memcg with ksm also call it, so delete the CONFIG_PROC_FS compilation dependency to make it more general.
Fixes: 8bafb5eac5a6 ("memcg: support ksm merge any mode per cgroup") Signed-off-by: Nanyong Sun sunnanyong@huawei.com --- include/linux/ksm.h | 2 -- mm/ksm.c | 2 -- 2 files changed, 4 deletions(-)
diff --git a/include/linux/ksm.h b/include/linux/ksm.h index c2dd786a30e1..49779f85e1da 100644 --- a/include/linux/ksm.h +++ b/include/linux/ksm.h @@ -87,9 +87,7 @@ void collect_procs_ksm(struct page *page, struct list_head *to_kill, int force_early); #endif
-#ifdef CONFIG_PROC_FS long ksm_process_profit(struct mm_struct *); -#endif /* CONFIG_PROC_FS */
#else /* !CONFIG_KSM */
diff --git a/mm/ksm.c b/mm/ksm.c index 7401a6c87a4b..dba6a2eb1a3c 100644 --- a/mm/ksm.c +++ b/mm/ksm.c @@ -3106,13 +3106,11 @@ static void wait_while_offlining(void) } #endif /* CONFIG_MEMORY_HOTREMOVE */
-#ifdef CONFIG_PROC_FS long ksm_process_profit(struct mm_struct *mm) { return (long)(mm->ksm_merging_pages + mm->ksm_zero_pages) * PAGE_SIZE - mm->ksm_rmap_items * sizeof(struct ksm_rmap_item); } -#endif /* CONFIG_PROC_FS */
#ifdef CONFIG_SYSFS /*