All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] tracing/mm: Don't trace kmem_cache_free on offline cpus
@ 2015-04-28 15:51 Shreyas B. Prabhu
  2015-04-28 15:51 ` [PATCH 2/3] tracing/mm: Don't trace mm_page_free " Shreyas B. Prabhu
                   ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: Shreyas B. Prabhu @ 2015-04-28 15:51 UTC (permalink / raw)
  To: linux-kernel; +Cc: rostedt, mingo, aneesh.kumar, Shreyas B. Prabhu

Since tracepoints use RCU for protection, they must not be called on
offline cpus. trace_kmem_cache_free can be called on an offline cpu in
this scenario caught by LOCKDEP:

===============================
[ INFO: suspicious RCU usage. ]
4.1.0-rc1+ #9 Not tainted
-------------------------------
include/trace/events/kmem.h:148 suspicious rcu_dereference_check() usage!

other info that might help us debug this:

RCU used illegally from offline CPU!
rcu_scheduler_active = 1, debug_locks = 1
no locks held by swapper/1/0.

stack backtrace:
CPU: 1 PID: 0 Comm: swapper/1 Not tainted 4.1.0-rc1+ #9
Call Trace:
[c000001fed2f78f0] [c0000000009dee8c] .dump_stack+0x98/0xd4 (unreliable)
[c000001fed2f7970] [c000000000128d88] .lockdep_rcu_suspicious+0x108/0x170
[c000001fed2f7a00] [c00000000026f924] .kmem_cache_free+0x344/0x4b0
[c000001fed2f7ab0] [c0000000000bd1cc] .__mmdrop+0x4c/0x160
[c000001fed2f7b40] [c0000000001068e0] .idle_task_exit+0xf0/0x100
[c000001fed2f7bc0] [c000000000066948] .pnv_smp_cpu_kill_self+0x58/0x2c0
[c000001fed2f7ca0] [c00000000003ce34] .cpu_die+0x34/0x50
[c000001fed2f7d10] [c0000000000176d0] .arch_cpu_idle_dead+0x20/0x40
[c000001fed2f7d80] [c00000000011f9a8] .cpu_startup_entry+0x708/0x7a0
[c000001fed2f7ec0] [c00000000003cb6c] .start_secondary+0x36c/0x3a0
[c000001fed2f7f90] [c000000000008b6c] start_secondary_prolog+0x10/0x14

Fix this by converting kmem_cache_free trace point into TRACE_EVENT_CONDITION
where condition is cpu_online(smp_processor_id())

Signed-off-by: Shreyas B. Prabhu <shreyas@linux.vnet.ibm.com>
Reported-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
---
 include/trace/events/kmem.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/include/trace/events/kmem.h b/include/trace/events/kmem.h
index 81ea598..dd9e612 100644
--- a/include/trace/events/kmem.h
+++ b/include/trace/events/kmem.h
@@ -140,11 +140,13 @@ DEFINE_EVENT(kmem_free, kfree,
 	TP_ARGS(call_site, ptr)
 );
 
-DEFINE_EVENT(kmem_free, kmem_cache_free,
+DEFINE_EVENT_CONDITION(kmem_free, kmem_cache_free,
 
 	TP_PROTO(unsigned long call_site, const void *ptr),
 
-	TP_ARGS(call_site, ptr)
+	TP_ARGS(call_site, ptr),
+
+	TP_CONDITION(cpu_online(smp_processor_id()))
 );
 
 TRACE_EVENT(mm_page_free,
-- 
1.9.3


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

end of thread, other threads:[~2015-05-08 16:40 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-28 15:51 [PATCH 1/3] tracing/mm: Don't trace kmem_cache_free on offline cpus Shreyas B. Prabhu
2015-04-28 15:51 ` [PATCH 2/3] tracing/mm: Don't trace mm_page_free " Shreyas B. Prabhu
2015-04-29  9:06   ` Preeti Murthy
2015-04-29  9:07     ` Preeti Murthy
2015-04-28 15:51 ` [PATCH 3/3] tracing/mm: Don't trace mm_page_pcpu_drain " Shreyas B. Prabhu
2015-04-29  9:13   ` Preeti Murthy
2015-04-29 14:49     ` Shreyas B Prabhu
2015-04-29 15:18       ` Steven Rostedt
2015-04-29 15:58         ` Shreyas B Prabhu
2015-04-29 17:08           ` Steven Rostedt
2015-04-29 17:19             ` Shreyas B Prabhu
2015-04-30  4:36               ` Preeti Murthy
2015-04-30  4:41                 ` Shreyas B Prabhu
2015-05-08  4:37             ` Shreyas B Prabhu
2015-05-08 14:18               ` Steven Rostedt
2015-05-08 16:39                 ` Shreyas B Prabhu
2015-04-29  9:04 ` [PATCH 1/3] tracing/mm: Don't trace kmem_cache_free " Preeti Murthy

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.