public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [Bug kprobes/2062] New: Return probes does not scale well on SMP box
@ 2005-12-16  1:58 anil dot s dot keshavamurthy at intel dot com
  2006-04-18  5:35 ` [Bug kprobes/2062] " guanglei at cn dot ibm dot com
                   ` (31 more replies)
  0 siblings, 32 replies; 35+ messages in thread
From: anil dot s dot keshavamurthy at intel dot com @ 2005-12-16  1:58 UTC (permalink / raw)
  To: systemtap

> I did a through code review for return probes and found that even though
> return probes are built on top of kprobes which is highly parallel, 
> return probes does *not* run in parallel :-(. 
> 
> On an SMP box, when multiple target function on different 
> cpu's tickles into trampline_probe_handler(), 
> all those thread on different cpus are serialized 
> via big spin_lock_irqsave(&kretprobe_lock, ...).

[Jim] Correct.

> Can we do some thing here to make return probes run in 
> parallel on SMP box? Any thoughts?
[Jim]
Yes, I think we can probably make it so kretprobe handlers can run in
parallel.  Each task is responsible for recycling its own
kretprobe_instances, so I don't think we have to hold a lock all
throughout trampoline_probe_handler().  No other task is going to sneak
in and recycle our task's kretprobe_instances.

One possibly tricky part is unregistering.  unregister_kretprobe()
assumes that every kretprobe_instance is either on the kretprobe's free
list or its used (in-use) list.  (If it's on the free list, it's
immediately freed.  Otherwise, its kretprobe pointer is set to NULL and
trampoline_probe_handler() frees it when the probed function returns.)
There are a couple of places where a kretprobe_instance is sort of in
transition, and doesn't really belong on either list.
1. While ri->rp->handler is being run, you can't clobber ri->rp, because
the handler may be using it.
2. In (TBD) user-space return probes, when we enter the probed function,
there's a moment where we've verified that there's a free
kretprobe_instance available to us, but we haven't yet copied and
replaced the return address in user space (not really an issue on ppc64
where the return addtress is in a register)... and we can't be
absolutely (100.0000000%) sure that those user-space accesses will
succeed.

Perhaps adding a state variable to struct kretprobe_instance would help
here.

-- 
           Summary: Return probes does not scale well on SMP box
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: kprobes
        AssignedTo: systemtap at sources dot redhat dot com
        ReportedBy: anil dot s dot keshavamurthy at intel dot com


http://sourceware.org/bugzilla/show_bug.cgi?id=2062

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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

end of thread, other threads:[~2006-11-16  1:08 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-12-16  1:58 [Bug kprobes/2062] New: Return probes does not scale well on SMP box anil dot s dot keshavamurthy at intel dot com
2006-04-18  5:35 ` [Bug kprobes/2062] " guanglei at cn dot ibm dot com
2006-04-18  5:37 ` guanglei at cn dot ibm dot com
2006-04-18 18:09 ` jkenisto at us dot ibm dot com
2006-04-18 19:32   ` James Dickens
2006-04-18 19:32 ` jamesd dot wi at gmail dot com
2006-04-18 20:22 ` jkenisto at us dot ibm dot com
2006-04-18 20:38 ` anil dot s dot keshavamurthy at intel dot com
2006-04-18 22:04 ` jkenisto at us dot ibm dot com
2006-04-18 23:48 ` anil dot s dot keshavamurthy at intel dot com
2006-04-19  3:54   ` James Dickens
     [not found] ` <20060418234829.24893.qmail@sourceware.org>
2006-04-18 23:54   ` Frank Ch. Eigler
2006-04-19  1:02 ` guanglei at cn dot ibm dot com
2006-04-19  1:07 ` guanglei at cn dot ibm dot com
2006-04-19  3:55 ` jamesd dot wi at gmail dot com
2006-04-19 21:44 ` jkenisto at us dot ibm dot com
2006-04-19 21:56 ` fche at redhat dot com
2006-04-19 23:53 ` jkenisto at us dot ibm dot com
2006-04-20  0:22 ` jkenisto at us dot ibm dot com
2006-07-07  9:24 ` guanglei at cn dot ibm dot com
2006-07-07  9:27 ` guanglei at cn dot ibm dot com
2006-07-07 17:47 ` jkenisto at us dot ibm dot com
2006-07-07 23:32 ` jkenisto at us dot ibm dot com
2006-07-07 23:34 ` jkenisto at us dot ibm dot com
2006-07-07 23:55 ` jkenisto at us dot ibm dot com
2006-07-08  5:14 ` guanglei at cn dot ibm dot com
2006-07-11 10:45 ` bibo dot mao at intel dot com
2006-07-11 11:15 ` ananth at in dot ibm dot com
2006-07-12  4:35 ` bibo dot mao at intel dot com
2006-07-13  6:10 ` bibo dot mao at intel dot com
2006-07-13  6:12 ` bibo dot mao at intel dot com
2006-07-13  6:21 ` bibo dot mao at intel dot com
2006-07-13 19:44 ` jkenisto at us dot ibm dot com
2006-07-14  8:13 ` bibo dot mao at intel dot com
2006-11-16  1:15 ` jkenisto at us 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).