This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[SYSTEMTAP/PATCH v3 8/9] stp: rt: replace stp_print lock with stp style lock


-rt mode preemptable spin lock lead to deadlock causes x86 box to freeze.
Replacing spin lock with stp type raw lock solves the problem. Observed
deadlock in make installcheck testsuite for sched_switch.stp test case.

Crash backtrace:
PID: 0      TASK: ffff880419f50000  CPU: 11  COMMAND: "swapper/11"
 #4 [ffff88042d963bc0] _raw_spin_lock at ffffffff81608c02
 #5 [ffff88042d963bd0] rt_spin_lock_slowlock at ffffffff81608204
 #6 [ffff88042d963c60] rt_spin_lock at ffffffff81608e25
 #7 [ffff88042d963c70] stp_print_flush at ffffffffa07e235b [stap_b232c01b8c036276987b9a52a38f25eb__7614]
 #8 [ffff88042d963cb0] probe_2293 at ffffffffa07e365c [stap_b232c01b8c036276987b9a52a38f25eb__7614]
 #9 [ffff88042d963cf0] enter_real_tracepoint_probe_0 at ffffffffa07e607f [stap_b232c01b8c036276987b9a52a38f25eb__7614]

PID: 0      TASK: ffff880419f36780  CPU: 10  COMMAND: "swapper/10"
 #4 [ffff88042d943bc0] _raw_spin_lock at ffffffff81608bf8
 #5 [ffff88042d943bd0] rt_spin_lock_slowlock at ffffffff81608204
 #6 [ffff88042d943c60] rt_spin_lock at ffffffff81608e25
 #7 [ffff88042d943c70] stp_print_flush at ffffffffa07e235b [stap_b232c01b8c036276987b9a52a38f25eb__7614]
 #8 [ffff88042d943cb0] probe_2293 at ffffffffa07e365c [stap_b232c01b8c036276987b9a52a38f25eb__7614]
 #9 [ffff88042d943cf0] enter_real_tracepoint_probe_0 at ffffffffa07e607f [stap_b232c01b8c036276987b9a52a38f25eb__7614]

PID: 0      TASK: ffff880419f35a90  CPU: 9   COMMAND: "swapper/9"
 #4 [ffff88042d923bc0] _raw_spin_lock at ffffffff81608bf8
 #5 [ffff88042d923bd0] rt_spin_lock_slowlock at ffffffff81608204
 #6 [ffff88042d923c60] rt_spin_lock at ffffffff81608e25
 #7 [ffff88042d923c70] stp_print_flush at ffffffffa07e235b [stap_b232c01b8c036276987b9a52a38f25eb__7614]
 #8 [ffff88042d923cb0] probe_2293 at ffffffffa07e365c [stap_b232c01b8c036276987b9a52a38f25eb__7614]
 #9 [ffff88042d923cf0] enter_real_tracepoint_probe_0 at ffffffffa07e607f [stap_b232c01b8c036276987b9a52a38f25eb__7614]

Signed-off-by: Santosh Shukla <sshukla@mvista.com>
---
 runtime/print_flush.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/runtime/print_flush.c b/runtime/print_flush.c
index a742159..4ef761d 100644
--- a/runtime/print_flush.c
+++ b/runtime/print_flush.c
@@ -16,7 +16,7 @@
  * @note Preemption must be disabled to use this.
  */
 
-static DEFINE_SPINLOCK(_stp_print_lock);
+static STP_DEFINE_SPINLOCK(_stp_print_lock);
 
 void EXPORT_FN(stp_print_flush)(_stp_pbuf *pb)
 {
@@ -130,7 +130,7 @@ void EXPORT_FN(stp_print_flush)(_stp_pbuf *pb)
 		c = _stp_runtime_entryfn_get_context();
 
 		dbug_trans(1, "calling _stp_data_write...\n");
-		spin_lock_irqsave(&_stp_print_lock, flags);
+		stp_spin_lock_irqsave(&_stp_print_lock, flags);
 		while (len > 0) {
 			size_t bytes_reserved;
 
@@ -147,7 +147,7 @@ void EXPORT_FN(stp_print_flush)(_stp_pbuf *pb)
 			    break;
 			}
 		}
-		spin_unlock_irqrestore(&_stp_print_lock, flags);
+		stp_spin_unlock_irqrestore(&_stp_print_lock, flags);
 		_stp_runtime_entryfn_put_context(c);
 	}
 #endif /* STP_TRANSPORT_VERSION != 1 */
-- 
1.8.3.1


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]