Skip to content

Commit f99d27d

Browse files
Sebastian Andrzej Siewiorpetrpavlu
authored andcommitted
LoongArch/orc: Use RCU in all users of __module_address().
__module_address() can be invoked within a RCU section, there is no requirement to have preemption disabled. Replace the preempt_disable() section around __module_address() with RCU. Cc: Huacai Chen <chenhuacai@kernel.org> Cc: WANG Xuerui <kernel@xen0n.name> Cc: loongarch@lists.linux.dev Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lore.kernel.org/r/20250108090457.512198-19-bigeasy@linutronix.de Signed-off-by: Petr Pavlu <petr.pavlu@suse.com>
1 parent 17a9992 commit f99d27d

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

arch/loongarch/kernel/unwind_orc.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ bool unwind_next_frame(struct unwind_state *state)
399399
return false;
400400

401401
/* Don't let modules unload while we're reading their ORC data. */
402-
preempt_disable();
402+
guard(rcu)();
403403

404404
if (is_entry_func(state->pc))
405405
goto end;
@@ -514,14 +514,12 @@ bool unwind_next_frame(struct unwind_state *state)
514514
if (!__kernel_text_address(state->pc))
515515
goto err;
516516

517-
preempt_enable();
518517
return true;
519518

520519
err:
521520
state->error = true;
522521

523522
end:
524-
preempt_enable();
525523
state->stack_info.type = STACK_TYPE_UNKNOWN;
526524
return false;
527525
}

0 commit comments

Comments
 (0)