[lkml]   [2017]   [Mar]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [RFC PATCH tip/master 2/3] kprobes: Allocate kretprobe instance if its free list is empty

* Masami Hiramatsu <> wrote:

> > So this is something I missed while the original code was merged, but the concept
> > looks a bit weird: why do we do any "allocation" while a handler is executing?
> >
> > That's fundamentally fragile. What's the maximum number of parallel
> > 'kretprobe_instance' required per kretprobe - one per CPU?
> It depends on the place where we put the probe. If the probed function will be
> blocked (yield to other tasks), then we need a same number of threads on
> the system which can invoke the function. So, ultimately, it is same
> as function_graph tracer, we need it for each thread.

So then put it into task_struct (assuming there's no kretprobe-inside-kretprobe
nesting allowed). There's just no way in hell we should be calling any complex
kernel function from kernel probes!

I mean, think about it, a kretprobe can be installed in a lot of places, and now
we want to call get_free_pages() from it?? This would add a massive amount of

Instrumentation must be _simple_, every patch that adds more complexity to the
most fundamental code path of it should raise a red flag ...

So let's make this more robust, ok?



 \ /
  Last update: 2017-03-30 08:54    [W:17.116 / U:0.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site