init_on_alloc: Optimize static branches
authorKees Cook <keescook@chromium.org>
Thu, 1 Apr 2021 23:23:43 +0000 (16:23 -0700)
committerThomas Gleixner <tglx@linutronix.de>
Thu, 8 Apr 2021 12:05:19 +0000 (14:05 +0200)
commit51cba1ebc60df9c4ce034a9f5441169c0d0956c0
tree9f3f79596f1922730ac3d2a90a47ad493484c75d
parent0d66ccc1627013c95f1e7ef10b95b8451cd7834e
init_on_alloc: Optimize static branches

The state of CONFIG_INIT_ON_ALLOC_DEFAULT_ON (and ...ON_FREE...) did not
change the assembly ordering of the static branches: they were always out
of line. Use the new jump_label macros to check the CONFIG settings to
default to the "expected" state, which slightly optimizes the resulting
assembly code.

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Alexander Potapenko <glider@google.com>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Link: https://lore.kernel.org/r/20210401232347.2791257-3-keescook@chromium.org
include/linux/mm.h
mm/page_alloc.c
mm/slab.h