This is the mail archive of the
systemtap@sources.redhat.com
mailing list for the systemtap project.
Re: Question: kprobe fault handler
On Tue, May 10, 2005 at 07:16:14PM -0400, Ananth N Mavinakayanahalli wrote:
> On Tue, May 10, 2005 at 04:01:58PM -0700, Keshavamurthy Anil S wrote:
> > On Tue, May 10, 2005 at 04:34:42PM -0400, Ananth N Mavinakayanahalli wrote:
> > > On Tue, May 10, 2005 at 12:35:48PM -0700, Keshavamurthy, Anil S wrote:
> >
> > > I think the best explaination as to why that hook is needed in the
> > > fast-path was given by Dave Miller. Please see:
> > >
> > > http://marc.theaimsgroup.com/?l=linux-kernel&m=109898820219611&w=2
> > Thanks for the link.
> >
> > >
> > > The overhead is: notifier_call_chain() -> kprobe_running() check in
> > > kprobe_exceptions_notify(). And, if any other debugger/utility
> > > (eg., kgdb) is using the die_notifier, it will also be invoked.
> >
> > So you are saying that for every page fault, the overhead is
> > notifier_call_chain()->kprobe_exception_notify()->kprobe_running(),
> > I agree this is very small when you don't have any kprobes registered.
> >
> > Imagine a case where 1000 Kprobes are registered and in this
> > case for every pagefault, notifier_call_chain() has to loop for 1000
> > times, this seems to me an overkill. Please correct me if I am wrong.
>
> No, notifier_call_chain() won't notify _every_ kprobe. Remember,
> kprobe_running() will return true _only_ if kprobe_cpu is set, ie., only
> if you are processing a kprobe. So, the notifier call is made only once,
> irrespective of the number of kprobes registered.
Cool! and thanks for the explanation.
-Anil
>
> Ananth