linux/init
Peter Zijlstra 91a1d97ef4 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) <peterz@infradead.org>
Signed-off-by: Valentin Schneider <vschneid@redhat.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Josh Poimboeuf <jpoimboe@kernel.org>
Link: https://lore.kernel.org/r/20240313180106.2917308-2-vschneid@redhat.com
2024-03-22 11:18:16 +01:00
..
.gitignore kbuild: build init/built-in.a just once 2022-09-29 04:40:15 +09:00
build-version kbuild: build init/built-in.a just once 2022-09-29 04:40:15 +09:00
calibrate.c
do_mounts_initrd.c init: pass root_device_name explicitly 2023-06-05 10:55:20 -06:00
do_mounts_rd.c
do_mounts.c init: flush async file closing 2024-02-08 18:41:03 +01:00
do_mounts.h init: flush async file closing 2024-02-08 18:41:03 +01:00
init_task.c rcu-tasks: Initialize data to eliminate RCU-tasks/do_exit() deadlocks 2024-02-25 14:21:43 -08:00
initramfs.c - Sumanth Korikkar has taught s390 to allocate hotplug-time page frames 2024-03-14 17:43:30 -07:00
Kconfig Networking changes for 6.9. 2024-03-12 17:44:08 -07:00
main.c jump_label,module: Don't alloc static_key_mod for __ro_after_init keys 2024-03-22 11:18:16 +01:00
Makefile x86/retpoline: Make sure there are no unconverted return thunks due to KCSAN 2023-10-20 13:02:23 +02:00
noinitramfs.c init: move usermodehelper_enable() to populate_rootfs() 2021-09-08 11:50:27 -07:00
version-timestamp.c init/version-timestamp.c: remove unneeded #include <linux/version.h> 2023-01-09 07:34:38 +09:00
version.c init/version.c: Replace strlcpy with strscpy 2023-09-22 09:50:56 -07:00