This is the mail archive of the systemtap@sources.redhat.com 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]

RE: reentrant probes


Frank Ch. Eigler <> wrote on Monday, May 02, 2005 10:41 AM:

> Hi -
> 
>>> [...]  I think it will be quite useful to allow renentrancy in
>>> probes.  Not sure why would you want to restrict this.  [...]
>> 
>> It seems hazardous [...]
> 
> I have a different example of the hazards of reentrant probe handling.
> Consider a single systemtap session, running
> 
>         global a
>         probe kernel.function("foo") { ... a[0] ++ ... }
>         probe perfcounter.tlbmiss(20) { ... a[0] ++ ... }
> 
> If the perfcounter interrupt is allowed to be taken while the "foo"
> probe handler is running and has a lock on the "a" array, then we can
> deadlock.


Well....how is this different from any other scenario in kernel
programming.  You are touching a global variable. Probe writer needs to
know under what situations that function can be used.  For a scenario
like above, you will have to disable the interrupts as you grab the lock
the first time (else nested interrupts will be just enough to spoil your
results in probe.perfcounter.tlbmiss execution path itself).

-rohit


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