]> Git Repo - linux.git/commit
jump_label,module: Don't alloc static_key_mod for __ro_after_init keys
authorPeter Zijlstra <[email protected]>
Wed, 13 Mar 2024 18:01:03 +0000 (19:01 +0100)
committerIngo Molnar <[email protected]>
Fri, 22 Mar 2024 10:18:16 +0000 (11:18 +0100)
commit91a1d97ef482c1e4c9d4c1c656a53b0f6b16d0ed
tree0a5984cd9f64775013f069da345663f8330854c9
parent3774b28d8f3b9e8a946beb9550bee85e5454fc9f
jump_label,module: Don't alloc static_key_mod for __ro_after_init keys

When a static_key is marked ro_after_init, its state will never change
(after init), therefore jump_label_update() will never need to iterate
the entries, and thus module load won't actually need to track this --
avoiding the static_key::next write.

Therefore, mark these keys such that jump_label_add_module() might
recognise them and avoid the modification.

Use the special state: 'static_key_linked(key) && !static_key_mod(key)'
to denote such keys.

jump_label_add_module() does not exist under CONFIG_JUMP_LABEL=n, so the
newly-introduced jump_label_init_ro() can be defined as a nop for that
configuration.

[ mingo: Renamed jump_label_ro() to jump_label_init_ro() ]

Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Signed-off-by: Valentin Schneider <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
Acked-by: Josh Poimboeuf <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
include/asm-generic/sections.h
include/linux/jump_label.h
init/main.c
kernel/jump_label.c
This page took 0.068396 seconds and 4 git commands to generate.