linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm: Add process info to bad rss-counter warning
@ 2025-07-23 10:09 Xuanye Liu
  2025-07-23 16:40 ` SeongJae Park
  0 siblings, 1 reply; 2+ messages in thread
From: Xuanye Liu @ 2025-07-23 10:09 UTC (permalink / raw)
  To: Ingo Molnar, Peter Zijlstra, Juri Lelli, Vincent Guittot,
	Andrew Morton, David Hildenbrand, Kees Cook
  Cc: Xuanye Liu, Dietmar Eggemann, Steven Rostedt, Ben Segall,
	Mel Gorman, Valentin Schneider, Lorenzo Stoakes, Liam R. Howlett,
	Vlastimil Babka, Mike Rapoport, Suren Baghdasaryan, Michal Hocko,
	linux-kernel, linux-mm

Enhance the debugging information in check_mm() by including the
process name and PID when reporting bad rss-counter states. This
helps identify which process is associated with the memory accounting
issue.

Signed-off-by: Xuanye Liu <liuqiye2025@163.com>
---
 kernel/fork.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/kernel/fork.c b/kernel/fork.c
index cfe2f1df5f27..e02fa515b77c 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -584,9 +584,12 @@ static void check_mm(struct mm_struct *mm)
 	for (i = 0; i < NR_MM_COUNTERS; i++) {
 		long x = percpu_counter_sum(&mm->rss_stat[i]);
 
-		if (unlikely(x))
-			pr_alert("BUG: Bad rss-counter state mm:%p type:%s val:%ld\n",
-				 mm, resident_page_types[i], x);
+		if (unlikely(x)) {
+			pr_alert("BUG: Bad rss-counter state mm:%p type:%s val:%ld Comm:%s Pid:%d\n",
+				 mm, resident_page_types[i], x,
+				 current->comm,
+				 task_pid_nr(current));
+		}
 	}
 
 	if (mm_pgtables_bytes(mm))
-- 
2.43.0



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-07-23 16:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-07-23 10:09 [PATCH] mm: Add process info to bad rss-counter warning Xuanye Liu
2025-07-23 16:40 ` SeongJae Park

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox