Message ID | 20250108090457.512198-21-bigeasy@linutronix.de (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | module: Use RCU instead of RCU-sched. | expand |
Context | Check | Description |
---|---|---|
mcgrof/vmtest-modules-next-PR | fail | PR summary |
mcgrof/vmtest-modules-next-VM_Test-0 | success | Logs for Run CI tests |
mcgrof/vmtest-modules-next-VM_Test-2 | success | Logs for setup / Setup kdevops environment |
mcgrof/vmtest-modules-next-VM_Test-1 | success | Logs for cleanup / Archive results and cleanup |
On 1/8/25 14:34, Sebastian Andrzej Siewior wrote: > __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 <christophe.leroy@csgroup.eu> > Cc: Madhavan Srinivasan <maddy@linux.ibm.com> > Cc: Mark Rutland <mark.rutland@arm.com> > Cc: Masami Hiramatsu <mhiramat@kernel.org> > Cc: Michael Ellerman <mpe@ellerman.id.au> > Cc: Naveen N Rao <naveen@kernel.org> > Cc: Nicholas Piggin <npiggin@gmail.com> > Cc: Steven Rostedt <rostedt@goodmis.org> > Cc: linux-trace-kernel@vger.kernel.org > Cc: linuxppc-dev@lists.ozlabs.org > Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org> > Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> > --- > arch/powerpc/kernel/trace/ftrace.c | 6 ++---- > arch/powerpc/kernel/trace/ftrace_64_pg.c | 6 ++---- > 2 files changed, 4 insertions(+), 8 deletions(-) > Ran ftrace (function graph) on preempt=full kernel with rcutorture while doing modprobe/rmmod. rcutorture succeeded and didn't see any splats. If there is any other method to test it out, please let me know. So for powerpc bits: Tested-by: Shrikanth Hegde <sshegde@linux.ibm.com> > diff --git a/arch/powerpc/kernel/trace/ftrace.c b/arch/powerpc/kernel/trace/ftrace.c > index 5ccd791761e8f..558d7f4e4bea6 100644 > --- a/arch/powerpc/kernel/trace/ftrace.c > +++ b/arch/powerpc/kernel/trace/ftrace.c > @@ -115,10 +115,8 @@ static unsigned long ftrace_lookup_module_stub(unsigned long ip, unsigned long a > { > struct module *mod = NULL; > > - preempt_disable(); > - mod = __module_text_address(ip); > - preempt_enable(); > - > + scoped_guard(rcu) > + mod = __module_text_address(ip); > if (!mod) > pr_err("No module loaded at addr=%lx\n", ip); > > diff --git a/arch/powerpc/kernel/trace/ftrace_64_pg.c b/arch/powerpc/kernel/trace/ftrace_64_pg.c > index 98787376eb87c..531d40f10c8a1 100644 > --- a/arch/powerpc/kernel/trace/ftrace_64_pg.c > +++ b/arch/powerpc/kernel/trace/ftrace_64_pg.c > @@ -120,10 +120,8 @@ static struct module *ftrace_lookup_module(struct dyn_ftrace *rec) > { > struct module *mod; > > - preempt_disable(); > - mod = __module_text_address(rec->ip); > - preempt_enable(); > - > + scoped_guard(rcu) > + mod = __module_text_address(rec->ip); > if (!mod) > pr_err("No module loaded at addr=%lx\n", rec->ip); >
diff --git a/arch/powerpc/kernel/trace/ftrace.c b/arch/powerpc/kernel/trace/ftrace.c index 5ccd791761e8f..558d7f4e4bea6 100644 --- a/arch/powerpc/kernel/trace/ftrace.c +++ b/arch/powerpc/kernel/trace/ftrace.c @@ -115,10 +115,8 @@ static unsigned long ftrace_lookup_module_stub(unsigned long ip, unsigned long a { struct module *mod = NULL; - preempt_disable(); - mod = __module_text_address(ip); - preempt_enable(); - + scoped_guard(rcu) + mod = __module_text_address(ip); if (!mod) pr_err("No module loaded at addr=%lx\n", ip); diff --git a/arch/powerpc/kernel/trace/ftrace_64_pg.c b/arch/powerpc/kernel/trace/ftrace_64_pg.c index 98787376eb87c..531d40f10c8a1 100644 --- a/arch/powerpc/kernel/trace/ftrace_64_pg.c +++ b/arch/powerpc/kernel/trace/ftrace_64_pg.c @@ -120,10 +120,8 @@ static struct module *ftrace_lookup_module(struct dyn_ftrace *rec) { struct module *mod; - preempt_disable(); - mod = __module_text_address(rec->ip); - preempt_enable(); - + scoped_guard(rcu) + mod = __module_text_address(rec->ip); if (!mod) pr_err("No module loaded at addr=%lx\n", rec->ip);