]> sourceware.org Git - systemtap.git/commit
Prevent lock-recursion in _stp_ctl_send
authorJosh Stone <jistone@redhat.com>
Thu, 17 Apr 2014 21:32:40 +0000 (14:32 -0700)
committerJosh Stone <jistone@redhat.com>
Thu, 17 Apr 2014 22:25:37 +0000 (15:25 -0700)
commitd2d39de66492401c349907d59a63b9c95cfba2ad
tree6cb4d5b6e515ad87380939770cfe69c552523d5d
parent7b51754b39156f28397fbfe2026d01c9c0e0a7f6
Prevent lock-recursion in _stp_ctl_send

In rare cases, we may hit a probe while the transport layer is holding a
spinlock, and that probe may call _stp_ctl_send which tries to grab the
same and deadlocks.  This is a bit easier to trigger on lockdep-enabled
kernels with the lock_acquired tracepoint.

This patch refactors the context->busy state management into get/put
context, and those areas which grab probe-sensitive locks now wrap
themselves with a context to stay comfortably free of probes.

Tangentially, the dyninst side abandons the busy flag, as it already had
a tls_context pointer to prevent direct recursion and a mutex for
exclusive access across all processes.

DEBUG_REENTRANCY is an unfortunate casualty, because we can't safely
call _stp_warn when the busy context may be from those held locks.
runtime/common_probe_context.h
runtime/dyninst/runtime_context.h
runtime/linux/runtime_context.h
runtime/transport/control.c
runtime/transport/transport.c
tapset-procfs.cxx
tapsets.cxx
This page took 0.029383 seconds and 5 git commands to generate.