This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
[SYSTEMTAP/PATCH v3 9/9] stp: rt: fix preemptible bug_on for STAT_GET_CPU
- From: Santosh Shukla <sshukla at mvista dot com>
- To: fche at redhat dot com, dsmith at redhat dot com, jistone at redhat dot com
- Cc: systemtap at sourceware dot org, Santosh Shukla <sshukla at mvista dot com>
- Date: Mon, 22 Sep 2014 12:57:02 +0530
- Subject: [SYSTEMTAP/PATCH v3 9/9] stp: rt: fix preemptible bug_on for STAT_GET_CPU
- Authentication-results: sourceware.org; auth=none
- References: <1411370822-8707-1-git-send-email-sshukla at mvista dot com>
STAT_GET_CPU to use raw_smp_xxx api in -rt fixes below bug on
BUG: using smp_processor_id() in preemptible [00000000 00000000] code: rmmod/56155
caller is _stp_stat_add+0x1d/0x1a0 [stap_4f58f85e0fd53d8fdc48b8abb0e89a5d_56139]
CPU: 6 PID: 56155 Comm: rmmod Tainted: GF O 3.14.12-rt-rt9+ #2
Hardware name: Intel Corporation S2600CP/S2600CP, BIOS SE5C600.86B.02.01.0002.082220131453 08/22/2013
ffff88040819ae80 ffff8803d86c7dc8 ffffffff81602b13 0000000000000006
ffff8803d86c7de0 ffffffff812e5575 000000006426532c ffff8803d86c7e08
ffffffffa0877c1d ffffffffa0883c00 ffffffffa0823118 00008fd170541a19
Call Trace:
[<ffffffff81602b13>] dump_stack+0x4e/0x7a
[<ffffffff812e5575>] debug_smp_processor_id+0x105/0x120
[<ffffffffa0877c1d>] _stp_stat_add+0x1d/0x1a0 [stap_4f58f85e0fd53d8fdc48b8abb0e89a5d_56139]
[<ffffffffa087ad0f>] systemtap_module_refresh+0x10f/0x1d0 [stap_4f58f85e0fd53d8fdc48b8abb0e89a5d_56139]
[<ffffffffa087c8a1>] _stp_module_notifier+0x41/0x1a0 [stap_4f58f85e0fd53d8fdc48b8abb0e89a5d_56139]
[<ffffffff8160d4ed>] ? kprobes_module_callback+0x12d/0x140
[<ffffffff8160c75c>] notifier_call_chain+0x4c/0x70
[<ffffffff8109805d>] __blocking_notifier_call_chain+0x4d/0x70
[<ffffffff81098096>] blocking_notifier_call_chain+0x16/0x20
[<ffffffff810eb006>] SyS_delete_module+0x146/0x1c0
[<ffffffff81611166>] ? int_signal+0x12/0x17
[<ffffffff81610ea9>] system_call_fastpath+0x16/0x1b
Signed-off-by: Santosh Shukla <sshukla@mvista.com>
---
runtime/linux/stat_runtime.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/runtime/linux/stat_runtime.h b/runtime/linux/stat_runtime.h
index 56152c9..5e27026 100644
--- a/runtime/linux/stat_runtime.h
+++ b/runtime/linux/stat_runtime.h
@@ -21,7 +21,11 @@
#define STAT_LOCK(sd) do {} while (0)
#define STAT_UNLOCK(sd) do {} while (0)
/* get/put_cpu wrappers. Unnecessary if caller is already atomic. */
+#ifdef CONFIG_PREEMPT_RT_FULL
+#define STAT_GET_CPU() raw_smp_processor_id()
+#else
#define STAT_GET_CPU() smp_processor_id()
+#endif
#define STAT_PUT_CPU() do {} while (0)
#endif
--
1.8.3.1