Skip to content

Commit ccf74e7

Browse files
Sebastian Andrzej Siewiorpetrpavlu
authored andcommitted
powerpc/ftrace: 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: Christophe Leroy <[email protected]> Cc: Madhavan Srinivasan <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Masami Hiramatsu <[email protected]> Cc: Michael Ellerman <[email protected]> Cc: Naveen N Rao <[email protected]> Cc: Nicholas Piggin <[email protected]> Cc: Steven Rostedt <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: Sebastian Andrzej Siewior <[email protected]> Acked-by: Peter Zijlstra (Intel) <[email protected]> Tested-by: Shrikanth Hegde <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Petr Pavlu <[email protected]>
1 parent 18d83c3 commit ccf74e7

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

arch/powerpc/kernel/trace/ftrace.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,8 @@ static unsigned long ftrace_lookup_module_stub(unsigned long ip, unsigned long a
115115
{
116116
struct module *mod = NULL;
117117

118-
preempt_disable();
119-
mod = __module_text_address(ip);
120-
preempt_enable();
121-
118+
scoped_guard(rcu)
119+
mod = __module_text_address(ip);
122120
if (!mod)
123121
pr_err("No module loaded at addr=%lx\n", ip);
124122

arch/powerpc/kernel/trace/ftrace_64_pg.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,8 @@ static struct module *ftrace_lookup_module(struct dyn_ftrace *rec)
120120
{
121121
struct module *mod;
122122

123-
preempt_disable();
124-
mod = __module_text_address(rec->ip);
125-
preempt_enable();
126-
123+
scoped_guard(rcu)
124+
mod = __module_text_address(rec->ip);
127125
if (!mod)
128126
pr_err("No module loaded at addr=%lx\n", rec->ip);
129127

0 commit comments

Comments
 (0)