Re: [PATCH v6 06/17] static_call: Add basic static call infrastructure

From: Steven Rostedt
Date: Fri Jul 10 2020 - 17:56:22 EST


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

> From: Josh Poimboeuf <jpoimboe@xxxxxxxxxx>
>
> Static calls are a replacement for global function pointers. They use
> code patching to allow direct calls to be used instead of indirect
> calls. They give the flexibility of function pointers, but with
> improved performance. This is especially important for cases where
> retpolines would otherwise be used, as retpolines can significantly
> impact performance.
>
> The concept and code are an extension of previous work done by Ard
> Biesheuvel and Steven Rostedt:
>
> https://lkml.kernel.org/r/20181005081333.15018-1-ard.biesheuvel@xxxxxxxxxx
> https://lkml.kernel.org/r/20181006015110.653946300@xxxxxxxxxxx
>
> There are two implementations, depending on arch support:
>
> 1) out-of-line: patched trampolines (CONFIG_HAVE_STATIC_CALL)
> 2) basic function pointers
>
> For more details, see the comments in include/linux/static_call.h.
>
> [peterz: simplified interface]
> Signed-off-by: Josh Poimboeuf <jpoimboe@xxxxxxxxxx>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx>

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

-- Steve