Re: [PATCH linux-next v3 4/6] ksm: make ksm_process_profit available on CONFIG_PROCFS=n

From: David Hildenbrand

Date: Tue Sep 23 2025 - 04:25:09 EST


On 21.09.25 17:13, xu.xin16@xxxxxxxxxx wrote:
From: xu xin <xu.xin16@xxxxxxxxxx>

This remove the restriction CONFIG_PROCFS=y for the heler function

s/heler/helper.

ksm_process_profit(), then we can use it for the later patches on
CONFIG_PROCFS=n.


Better to something like this:

"Let's provide ksm_process_profit() also without CONFIG_PROCFS so we can use it from memcg code next."

?


Reported-by: kernel test robot <lkp@xxxxxxxxx>
Closes: https://lore.kernel.org/all/202509142046.QatEaTQV-lkp@xxxxxxxxx/

Both tags should be dropped as there is nothing fixed here.

Signed-off-by: xu xin <xu.xin16@xxxxxxxxxx>
---
mm/ksm.c | 2 --
1 file changed, 2 deletions(-)

diff --git a/mm/ksm.c b/mm/ksm.c
index e49f4b86ffb0..a68d4b37b503 100644
--- a/mm/ksm.c
+++ b/mm/ksm.c
@@ -3282,7 +3282,6 @@ static void wait_while_offlining(void)
}
#endif /* CONFIG_MEMORY_HOTREMOVE */

-#ifdef CONFIG_PROC_FS
/*
* The process is mergeable only if any VMA is currently
* applicable to KSM.
@@ -3307,7 +3306,6 @@ long ksm_process_profit(struct mm_struct *mm)
return (long)(mm->ksm_merging_pages + mm_ksm_zero_pages(mm)) * PAGE_SIZE -
mm->ksm_rmap_items * sizeof(struct ksm_rmap_item);
}
-#endif /* CONFIG_PROC_FS */

#ifdef CONFIG_MEMCG
struct memcg_ksm_stat {


--
Cheers

David / dhildenb