All of lore.kernel.org
 help / color / mirror / Atom feed
* [merged mm-stable] memcontrol-add-ksm_profit-in-cgroup-memoryksm_stat.patch removed from -mm tree
@ 2025-05-13  6:55 Andrew Morton
  0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2025-05-13  6:55 UTC (permalink / raw)
  To: mm-commits, yang.yang29, wang.yaxin, songmuchun, shakeel.butt,
	roman.gushchin, muchun.song, mhocko, mhocko, hannes, david,
	chen.haonan2, xu.xin16, akpm


The quilt patch titled
     Subject: memcontrol: add ksm_profit in cgroup/memory.ksm_stat
has been removed from the -mm tree.  Its filename was
     memcontrol-add-ksm_profit-in-cgroup-memoryksm_stat.patch

This patch was dropped because it was merged into the mm-stable branch
of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: xu xin <xu.xin16@zte.com.cn>
Subject: memcontrol: add ksm_profit in cgroup/memory.ksm_stat
Date: Thu, 1 May 2025 04:15:49 +0000

Users can obtain ksm_profit of a cgroup just by:

/ # cat /sys/fs/cgroup/memory.ksm_stat
ksm_rmap_items 76800
ksm_zero_pages 0
ksm_merging_pages 76800
ksm_profit 309657600

[akpm@linux-foundation.org: make ksm_process_profit() available on CONFIG_PROCFS=n]
Link: https://lkml.kernel.org/r/20250501041549.3324472-1-xu.xin16@zte.com.cn
Signed-off-by: xu xin <xu.xin16@zte.com.cn>
Cc: David Hildenbrand <david@redhat.com>
Cc: Haonan Chen <chen.haonan2@zte.com.cn>
Cc: Wang Yaxin <wang.yaxin@zte.com.cn>
Cc: Yang Yang <yang.yang29@zte.com.cn>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Muchun Song <muchun.song@linux.dev>
Cc: Muchun Song <songmuchun@bytedance.com>
Cc: Roman Gushchin <roman.gushchin@linux.dev>
Cc: Shakeel Butt <shakeel.butt@linux.dev>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/ksm.c        |    2 --
 mm/memcontrol.c |    4 ++++
 2 files changed, 4 insertions(+), 2 deletions(-)

--- a/mm/ksm.c~memcontrol-add-ksm_profit-in-cgroup-memoryksm_stat
+++ a/mm/ksm.c
@@ -3268,7 +3268,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.
@@ -3293,7 +3292,6 @@ long ksm_process_profit(struct mm_struct
 	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_SYSFS
 /*
--- a/mm/memcontrol.c~memcontrol-add-ksm_profit-in-cgroup-memoryksm_stat
+++ a/mm/memcontrol.c
@@ -4471,6 +4471,7 @@ struct memcg_ksm_stat {
 	unsigned long ksm_rmap_items;
 	long ksm_zero_pages;
 	unsigned long ksm_merging_pages;
+	long ksm_profit;
 };
 
 static int evaluate_memcg_ksm_stat(struct task_struct *task, void *arg)
@@ -4483,6 +4484,7 @@ static int evaluate_memcg_ksm_stat(struc
 		ksm_stat->ksm_rmap_items += mm->ksm_rmap_items;
 		ksm_stat->ksm_zero_pages += mm_ksm_zero_pages(mm);
 		ksm_stat->ksm_merging_pages += mm->ksm_merging_pages;
+		ksm_stat->ksm_profit += ksm_process_profit(mm);
 		mmput(mm);
 	}
 
@@ -4498,6 +4500,7 @@ static int memcg_ksm_stat_show(struct se
 	ksm_stat.ksm_rmap_items = 0;
 	ksm_stat.ksm_zero_pages = 0;
 	ksm_stat.ksm_merging_pages = 0;
+	ksm_stat.ksm_profit = 0;
 
 	/* summing all processes'ksm statistic items of this cgroup hierarchy */
 	mem_cgroup_scan_tasks(memcg, evaluate_memcg_ksm_stat, &ksm_stat);
@@ -4505,6 +4508,7 @@ static int memcg_ksm_stat_show(struct se
 	seq_printf(m, "ksm_rmap_items %lu\n", ksm_stat.ksm_rmap_items);
 	seq_printf(m, "ksm_zero_pages %ld\n", ksm_stat.ksm_zero_pages);
 	seq_printf(m, "ksm_merging_pages %ld\n", ksm_stat.ksm_merging_pages);
+	seq_printf(m, "ksm_profit %ld\n", ksm_stat.ksm_profit);
 
 	return 0;
 }
_

Patches currently in -mm which might be from xu.xin16@zte.com.cn are



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-05-13  6:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-13  6:55 [merged mm-stable] memcontrol-add-ksm_profit-in-cgroup-memoryksm_stat.patch removed from -mm tree Andrew Morton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.