From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: linux-modules@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Daniel Gomez <da.gomez@samsung.com>,
Luis Chamberlain <mcgrof@kernel.org>,
"Paul E . McKenney" <paulmck@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Petr Pavlu <petr.pavlu@suse.com>,
Sami Tolvanen <samitolvanen@google.com>,
Thomas Gleixner <tglx@linutronix.de>,
Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
Catalin Marinas <catalin.marinas@arm.com>,
Mark Rutland <mark.rutland@arm.com>,
Masami Hiramatsu <mhiramat@kernel.org>,
Steven Rostedt <rostedt@goodmis.org>,
Will Deacon <will@kernel.org>,
linux-arm-kernel@lists.infradead.org,
linux-trace-kernel@vger.kernel.org
Subject: [PATCH v3 17/28] arm64: module: Use RCU in all users of __module_text_address().
Date: Wed, 8 Jan 2025 10:04:46 +0100 [thread overview]
Message-ID: <20250108090457.512198-18-bigeasy@linutronix.de> (raw)
In-Reply-To: <20250108090457.512198-1-bigeasy@linutronix.de>
__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: Catalin Marinas <catalin.marinas@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Will Deacon <will@kernel.org>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-trace-kernel@vger.kernel.org
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
arch/arm64/kernel/ftrace.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/arch/arm64/kernel/ftrace.c b/arch/arm64/kernel/ftrace.c
index 245cb419ca24d..2b76939b6304f 100644
--- a/arch/arm64/kernel/ftrace.c
+++ b/arch/arm64/kernel/ftrace.c
@@ -257,14 +257,13 @@ static bool ftrace_find_callable_addr(struct dyn_ftrace *rec,
* dealing with an out-of-range condition, we can assume it
* is due to a module being loaded far away from the kernel.
*
- * NOTE: __module_text_address() must be called with preemption
- * disabled, but we can rely on ftrace_lock to ensure that 'mod'
+ * NOTE: __module_text_address() must be called within a RCU read
+ * section, but we can rely on ftrace_lock to ensure that 'mod'
* retains its validity throughout the remainder of this code.
*/
if (!mod) {
- preempt_disable();
+ guard(rcu)();
mod = __module_text_address(pc);
- preempt_enable();
}
if (WARN_ON(!mod))
--
2.47.1
next prev parent reply other threads:[~2025-01-08 9:05 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20250108090457.512198-1-bigeasy@linutronix.de>
2025-01-08 9:04 ` [PATCH v3 06/28] module: Use RCU in find_module_all() Sebastian Andrzej Siewior
2025-01-08 9:04 ` Sebastian Andrzej Siewior [this message]
2025-01-08 9:04 ` [PATCH v3 19/28] LoongArch: ftrace: Use RCU in all users of __module_text_address() Sebastian Andrzej Siewior
2025-01-08 9:04 ` [PATCH v3 20/28] powerpc/ftrace: " Sebastian Andrzej Siewior
2025-01-20 10:09 ` Shrikanth Hegde
2025-01-08 9:04 ` [PATCH v3 25/28] bpf: " Sebastian Andrzej Siewior
2025-01-09 18:38 ` Alexei Starovoitov
2025-01-09 20:54 ` Sebastian Andrzej Siewior
2025-01-09 21:00 ` Alexei Starovoitov
2025-01-29 8:47 ` [PATCH v3.5 " Sebastian Andrzej Siewior
2025-01-08 9:04 ` [PATCH v3 26/28] kprobes: " Sebastian Andrzej Siewior
2025-01-28 5:44 ` Masami Hiramatsu
2025-01-28 7:10 ` Sebastian Andrzej Siewior
2025-01-29 8:49 ` [PATCH v3.5 25/28] " Sebastian Andrzej Siewior
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250108090457.512198-18-bigeasy@linutronix.de \
--to=bigeasy@linutronix.de \
--cc=catalin.marinas@arm.com \
--cc=da.gomez@samsung.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-modules@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mcgrof@kernel.org \
--cc=mhiramat@kernel.org \
--cc=paulmck@kernel.org \
--cc=peterz@infradead.org \
--cc=petr.pavlu@suse.com \
--cc=rostedt@goodmis.org \
--cc=samitolvanen@google.com \
--cc=tglx@linutronix.de \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox