linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/2] rcu: Dump memory object info if callback function is invalid
@ 2023-08-02  3:45 thunder.leizhen
  2023-08-02  3:45 ` [PATCH v3 1/2] mm: Provide empty function for kmem_dump_obj() when CONFIG_PRINTK=n thunder.leizhen
  2023-08-02  3:45 ` [PATCH v3 2/2] rcu: Dump memory object info if callback function is invalid thunder.leizhen
  0 siblings, 2 replies; 7+ messages in thread
From: thunder.leizhen @ 2023-08-02  3:45 UTC (permalink / raw)
  To: Christoph Lameter, Pekka Enberg, David Rientjes, Joonsoo Kim,
	Andrew Morton, Vlastimil Babka, Roman Gushchin, Hyeonggon Yoo,
	linux-mm, Paul E . McKenney, Frederic Weisbecker,
	Neeraj Upadhyay, Joel Fernandes, Josh Triplett, Boqun Feng,
	Steven Rostedt, Mathieu Desnoyers, Lai Jiangshan, Zqiang, rcu,
	linux-kernel, openeuler

From: Zhen Lei <thunder.leizhen@huawei.com>

v2 --> v3:
1. I made statistics about the source of 'rhp'. kmem_valid_obj() accounts for
   more than 97.5%, and vmalloc accounts for less than 1%. So change call
   mem_dump_obj() to call kmem_dump_obj() can meet debugging requirements and
   avoid the potential deadlock risk of vmalloc_dump_obj().
-		mem_dump_obj(rhp);
+		if (kmem_valid_obj(rhp))
+			kmem_dump_obj(rhp);

   The discussion about vmap_area_lock deadlock in v2:
   https://lkml.org/lkml/2022/11/11/493

2. Provide static inline empty functions for kmem_valid_obj() and kmem_dump_obj()
   when CONFIG_PRINTK=n.

v1 --> v2:
1. Remove condition "(unsigned long)rhp->func & 0x3", it have problems on x86.
2. Paul E. McKenney helped me update the commit message, thanks.

Zhen Lei (2):
  mm: Provide empty function for kmem_dump_obj() when CONFIG_PRINTK=n
  rcu: Dump memory object info if callback function is invalid

 include/linux/slab.h  | 3 +++
 kernel/rcu/rcu.h      | 9 +++++++++
 kernel/rcu/srcutiny.c | 1 +
 kernel/rcu/srcutree.c | 1 +
 kernel/rcu/tasks.h    | 1 +
 kernel/rcu/tiny.c     | 1 +
 kernel/rcu/tree.c     | 1 +
 7 files changed, 17 insertions(+)

-- 
2.34.1



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

end of thread, other threads:[~2023-08-02 11:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-02  3:45 [PATCH v3 0/2] rcu: Dump memory object info if callback function is invalid thunder.leizhen
2023-08-02  3:45 ` [PATCH v3 1/2] mm: Provide empty function for kmem_dump_obj() when CONFIG_PRINTK=n thunder.leizhen
2023-08-02  3:57   ` Matthew Wilcox
2023-08-02 11:11     ` Leizhen (ThunderTown)
2023-08-02  3:45 ` [PATCH v3 2/2] rcu: Dump memory object info if callback function is invalid thunder.leizhen
2023-08-02  3:48   ` Matthew Wilcox
2023-08-02 11:12     ` Leizhen (ThunderTown)

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