linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] fixup for mm/debug: print vm_refcnt state when dumping the vma
@ 2024-12-26 20:03 Suren Baghdasaryan
  2025-01-07 18:49 ` Liam R. Howlett
  0 siblings, 1 reply; 4+ messages in thread
From: Suren Baghdasaryan @ 2024-12-26 20:03 UTC (permalink / raw)
  To: akpm
  Cc: peterz, willy, liam.howlett, lorenzo.stoakes, mhocko, vbabka,
	hannes, mjguzik, oliver.sang, mgorman, david, peterx, oleg, dave,
	paulmck, brauner, dhowells, hdanton, hughd, lokeshgidra, minchan,
	jannh, shakeel.butt, souravpanda, pasha.tatashin, klarasmodin,
	corbet, linux-doc, linux-mm, linux-kernel, kernel-team, surenb,
	kernel test robot

vma->vm_refcnt does not exist when CONFIG_PER_VMA_LOCK=n, therefore
when CONFIG_PER_VMA_LOCK=n and CONFIG_DEBUG_VM=y we need to avoid its
usage in dump_vma().

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202412270328.HiJX1mRt-lkp@intel.com/
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
---
Fixes https://lore.kernel.org/all/20241226170710.1159679-14-surenb@google.com/
posted over mm-unstable.

 mm/debug.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/mm/debug.c b/mm/debug.c
index 68b3ba3cf603..9c4cbc3733b0 100644
--- a/mm/debug.c
+++ b/mm/debug.c
@@ -178,6 +178,7 @@ EXPORT_SYMBOL(dump_page);
 
 void dump_vma(const struct vm_area_struct *vma)
 {
+#ifdef CONFIG_PER_VMA_LOCK
 	pr_emerg("vma %px start %px end %px mm %px\n"
 		"prot %lx anon_vma %px vm_ops %px\n"
 		"pgoff %lx file %px private_data %px\n"
@@ -187,6 +188,17 @@ void dump_vma(const struct vm_area_struct *vma)
 		vma->anon_vma, vma->vm_ops, vma->vm_pgoff,
 		vma->vm_file, vma->vm_private_data,
 		vma->vm_flags, &vma->vm_flags, refcount_read(&vma->vm_refcnt));
+#else
+	pr_emerg("vma %px start %px end %px mm %px\n"
+		"prot %lx anon_vma %px vm_ops %px\n"
+		"pgoff %lx file %px private_data %px\n"
+		"flags: %#lx(%pGv)\n",
+		vma, (void *)vma->vm_start, (void *)vma->vm_end, vma->vm_mm,
+		(unsigned long)pgprot_val(vma->vm_page_prot),
+		vma->anon_vma, vma->vm_ops, vma->vm_pgoff,
+		vma->vm_file, vma->vm_private_data,
+		vma->vm_flags, &vma->vm_flags);
+#endif
 }
 EXPORT_SYMBOL(dump_vma);
 
-- 
2.47.1.613.gc27f4b7a9f-goog



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

end of thread, other threads:[~2025-01-08 15:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-12-26 20:03 [PATCH 1/1] fixup for mm/debug: print vm_refcnt state when dumping the vma Suren Baghdasaryan
2025-01-07 18:49 ` Liam R. Howlett
2025-01-07 18:57   ` Suren Baghdasaryan
2025-01-08 15:51     ` Suren Baghdasaryan

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