* [Bug uprobes/9828] New: A uprobe probepoint hit may result in a lockdep warning message
@ 2009-02-09 10:58 srikar at linux dot vnet dot ibm dot com
2009-02-09 17:13 ` [Bug uprobes/9828] " srikar at linux dot vnet dot ibm dot com
0 siblings, 1 reply; 2+ messages in thread
From: srikar at linux dot vnet dot ibm dot com @ 2009-02-09 10:58 UTC (permalink / raw)
To: systemtap
With CONFIG_LOCKDEP configured, the first time after boot that a uprobes
probepoint is hit, lockdep_sys_exit() reports:
kernel: [ BUG: lock held when returning to user space! ]
kernel: ------------------------------------------------
kernel: bash/6578 is leaving the kernel with locks still held!
kernel: 2 locks held by bash/6578:
kernel: #0: (&uproc->rwsem){----}, at: [<c0103641>]
uprobe_report_signal+0x1d1/0x7f3
kernel: #1: (&slot->rwsem){--..}, at: [<c0103db5>]
uprobe_find_insn_slot+0x152/0x1de
--
Summary: A uprobe probepoint hit may result in a lockdep warning
message
Product: systemtap
Version: unspecified
Status: NEW
Severity: normal
Priority: P2
Component: uprobes
AssignedTo: systemtap at sources dot redhat dot com
ReportedBy: srikar at linux dot vnet dot ibm dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=9828
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Bug uprobes/9828] A uprobe probepoint hit may result in a lockdep warning message
2009-02-09 10:58 [Bug uprobes/9828] New: A uprobe probepoint hit may result in a lockdep warning message srikar at linux dot vnet dot ibm dot com
@ 2009-02-09 17:13 ` srikar at linux dot vnet dot ibm dot com
0 siblings, 0 replies; 2+ messages in thread
From: srikar at linux dot vnet dot ibm dot com @ 2009-02-09 17:13 UTC (permalink / raw)
To: systemtap
------- Additional Comments From srikar at linux dot vnet dot ibm dot com 2009-02-09 10:49 -------
Update from Jim Keniston:
-------------------------
Uprobes does indeed hold these semaphores read-locked while single-stepping
an instruction out-of-line:
1. uproc->rwsem -- prevents changes to the uprobe-process's data structures.
2. ppt->slot->rwsem -- prevents the SSOL slot from being stolen while it's
in use.
Uprobes has been doing that for ~2 years. The lockdep_sys_exit() check
was added to Linux maybe a year ago.
The BUG doesn't indicate a problem per se. Either the single-step
operation will complete successfully, or the task will die. In either
case, uprobes will unlock the semaphores. However, when the LOCKDEP
code reports such a problem, it then disables itself; so other,
potentially more serious problems are not reported.
As for #1 above, it's theoretically possible to unlock uproc->rwsem
just before kicking off the single-step operation. In PR #5509,
"uprobes booster thoughts," see the section that starts with "What
happens if the probepoint is unregistered while one or more threads
are executing the instructions in the SSOL slot?"
#2 is perhaps more problematic. Something similar can be achieved by
(essentially faking up a rwsem) using a reference count and a wait queue.
But that's just circumventing the LOCKDEP check. Another possibility
is to somehow ensure that the number of SSOL slots for each process
exceeds the number of threads; that way there's always
at least one slot not currently in use, and the slot seeker would
never have to wait.
One other way you can get a LOCKDEP BUG report
with uprobes is when uprobe_fork_uproc() calls uprobe_mk_process()
for the child (thus creating and locking the child's rwsem) while holding
the parent's rwsem. LOCKDEP doesn't like this. This report could be
suppressed by assigning a different class/level
to the child's rwsem.
--
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|systemtap at sources dot |srikar at linux dot vnet dot
|redhat dot com |ibm dot com
Status|NEW |ASSIGNED
http://sourceware.org/bugzilla/show_bug.cgi?id=9828
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-02-09 10:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-09 10:58 [Bug uprobes/9828] New: A uprobe probepoint hit may result in a lockdep warning message srikar at linux dot vnet dot ibm dot com
2009-02-09 17:13 ` [Bug uprobes/9828] " srikar at linux dot vnet dot ibm dot com
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).