Re: [PATCH v6 07/17] static_call: Add inline static call infrastructure

From: Steven Rostedt
Date: Fri Jul 10 2020 - 17:57:12 EST


On Fri, 10 Jul 2020 15:38:38 +0200
Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:

> From: Josh Poimboeuf <jpoimboe@xxxxxxxxxx>
>
> Add infrastructure for an arch-specific CONFIG_HAVE_STATIC_CALL_INLINE
> option, which is a faster version of CONFIG_HAVE_STATIC_CALL. At
> runtime, the static call sites are patched directly, rather than using
> the out-of-line trampolines.
>
> Compared to out-of-line static calls, the performance benefits are more
> modest, but still measurable. Steven Rostedt did some tracepoint
> measurements:
>
> https://lkml.kernel.org/r/20181126155405.72b4f718@xxxxxxxxxxxxxxxxxx
>
> This code is heavily inspired by the jump label code (aka "static
> jumps"), as some of the concepts are very similar.
>
> For more details, see the comments in include/linux/static_call.h.
>
> [peterz: simplified interface; merged trampolines]
> Signed-off-by: Josh Poimboeuf <jpoimboe@xxxxxxxxxx>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx>

Reviewed-by: Steven Rostedt (VMware) <rostedt@xxxxxxxxxxx>

-- Steve


> ---
> arch/Kconfig | 4
> include/asm-generic/vmlinux.lds.h | 7
> include/linux/module.h | 5
> include/linux/static_call.h | 36 ++++
> include/linux/static_call_types.h | 13 +
> kernel/Makefile | 1
> kernel/module.c | 5
> kernel/static_call.c | 303 ++++++++++++++++++++++++++++++++++++++
> 8 files changed, 373 insertions(+), 1 deletion(-)
> create mode 100644 kernel/static_call.c