Skip to content

Commit 72ee1c2

Browse files
Sebastian Andrzej Siewiorpetrpavlu
Sebastian Andrzej Siewior
authored andcommitted
jump_label: Use RCU in all users of __module_text_address().
__module_text_address() can be invoked within a RCU section, there is no requirement to have preemption disabled. Replace the preempt_disable() section around __module_text_address() with RCU. Cc: Ard Biesheuvel <[email protected]> Cc: Jason Baron <[email protected]> Cc: Josh Poimboeuf <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Steven Rostedt <[email protected]> Signed-off-by: Sebastian Andrzej Siewior <[email protected]> Acked-by: Peter Zijlstra (Intel) <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Petr Pavlu <[email protected]>
1 parent 4038131 commit 72ee1c2

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

kernel/jump_label.c

+6-7
Original file line numberDiff line numberDiff line change
@@ -653,13 +653,12 @@ static int __jump_label_mod_text_reserved(void *start, void *end)
653653
struct module *mod;
654654
int ret;
655655

656-
preempt_disable();
657-
mod = __module_text_address((unsigned long)start);
658-
WARN_ON_ONCE(__module_text_address((unsigned long)end) != mod);
659-
if (!try_module_get(mod))
660-
mod = NULL;
661-
preempt_enable();
662-
656+
scoped_guard(rcu) {
657+
mod = __module_text_address((unsigned long)start);
658+
WARN_ON_ONCE(__module_text_address((unsigned long)end) != mod);
659+
if (!try_module_get(mod))
660+
mod = NULL;
661+
}
663662
if (!mod)
664663
return 0;
665664

0 commit comments

Comments
 (0)