This is the mail archive of the
systemtap@sources.redhat.com
mailing list for the systemtap project.
RE: reentrant probes
- From: "Seth, Rohit" <rohit dot seth at intel dot com>
- To: "Frank Ch. Eigler" <fche at redhat dot com>, <systemtap at sources dot redhat dot com>
- Date: Mon, 2 May 2005 10:54:03 -0700
- Subject: 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