mirror of https://github.com/torvalds/linux.git
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 <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 Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org> Tested-by: Shrikanth Hegde <sshegde@linux.ibm.com> Link: https://lore.kernel.org/r/20250108090457.512198-21-bigeasy@linutronix.de Signed-off-by: Petr Pavlu <petr.pavlu@suse.com>
This commit is contained in:
parent
18d83c3654
commit
ccf74e79ea
|
|
@ -115,10 +115,8 @@ static unsigned long ftrace_lookup_module_stub(unsigned long ip, unsigned long a
|
||||||
{
|
{
|
||||||
struct module *mod = NULL;
|
struct module *mod = NULL;
|
||||||
|
|
||||||
preempt_disable();
|
scoped_guard(rcu)
|
||||||
mod = __module_text_address(ip);
|
mod = __module_text_address(ip);
|
||||||
preempt_enable();
|
|
||||||
|
|
||||||
if (!mod)
|
if (!mod)
|
||||||
pr_err("No module loaded at addr=%lx\n", ip);
|
pr_err("No module loaded at addr=%lx\n", ip);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -120,10 +120,8 @@ static struct module *ftrace_lookup_module(struct dyn_ftrace *rec)
|
||||||
{
|
{
|
||||||
struct module *mod;
|
struct module *mod;
|
||||||
|
|
||||||
preempt_disable();
|
scoped_guard(rcu)
|
||||||
mod = __module_text_address(rec->ip);
|
mod = __module_text_address(rec->ip);
|
||||||
preempt_enable();
|
|
||||||
|
|
||||||
if (!mod)
|
if (!mod)
|
||||||
pr_err("No module loaded at addr=%lx\n", rec->ip);
|
pr_err("No module loaded at addr=%lx\n", rec->ip);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue