mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
static_call: Add inline static call infrastructure
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@gandalf.local.home 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@redhat.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Signed-off-by: Ingo Molnar <mingo@kernel.org> Reviewed-by: Steven Rostedt (VMware) <rostedt@goodmis.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Link: https://lore.kernel.org/r/20200818135804.684334440@infradead.org
This commit is contained in:
parent
115284d89a
commit
9183c3f9ed
8 changed files with 373 additions and 1 deletions
|
@ -3274,6 +3274,11 @@ static int find_module_sections(struct module *mod, struct load_info *info)
|
|||
mod->kprobe_blacklist = section_objs(info, "_kprobe_blacklist",
|
||||
sizeof(unsigned long),
|
||||
&mod->num_kprobe_blacklist);
|
||||
#endif
|
||||
#ifdef CONFIG_HAVE_STATIC_CALL_INLINE
|
||||
mod->static_call_sites = section_objs(info, ".static_call_sites",
|
||||
sizeof(*mod->static_call_sites),
|
||||
&mod->num_static_call_sites);
|
||||
#endif
|
||||
mod->extable = section_objs(info, "__ex_table",
|
||||
sizeof(*mod->extable), &mod->num_exentries);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue