Re: [PATCH 07/15] mm: Add ___GFP_NOTRACE

From: Steven Rostedt
Date: Mon Mar 02 2015 - 13:43:37 EST


On Mon, 2 Mar 2015 10:12:32 -0800
Alexei Starovoitov <ast@xxxxxxxxxxxx> wrote:

> I'm not sure what would be the meaning of hash map that has all
> elements pre-allocated...
> As I'm reading your cover letter, I agree, we need to find a way
> to call kmalloc_notrace-like from tracepoints.
> Not sure that patch 8 style of duplicating the functions is clean.
> Can we keep kmalloc/kfree as-is and do something like
> if (in_tracepoint()) check inside ftrace_raw_kmalloc* ?

I'm strongly against this. You should not be doing anything in a
tracepoint that you can't do from NMI context. And calling kmalloc
happens to be one of them.

Not to mention, kmalloc is a hot path, and tracing must not have any
impact on it (no extra if statements).

-- Steve

> so that kmalloc will be traced but calls to kmalloc from inside
> tracepoints will be automatically suppressed ?

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/