Messages in this thread | | | Subject | Re: [PATCHv11 2.6.36-rc2-tip 5/15] 5: uprobes: Uprobes (un)registration and exception handling. | From | Peter Zijlstra <> | Date | Mon, 06 Sep 2010 20:15:21 +0200 |
| |
On Mon, 2010-09-06 at 23:16 +0530, Srikar Dronamraju wrote: > > > Unlike kernel probing, uprobes has a disadvantage. > > > Lets assume that the request for removing a probepoint when some of the > > > threads have actually hit the probe. Because the handlers in uprobes can > > > sleep, we cant remove the probepoint at the same time as the request for > > > the removing the probe. This is where refcount steps in and helps us to > > > decide when we can remove the probepoint. Even inoode based > > > tracing or file based tracing would need it. > > > > Stick the refcount in the actual struct uprobe instead? > > What if the called does something like this when one or more > threads are processing the breakpoint. > unregister_uprobe(u); > kfree(u);
That's what atomic_inc_unless_zero() and RCU are for.
| |