[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <176043134107.709179.3423388679418556938.tip-bot2@tip-bot2>
Date: Tue, 14 Oct 2025 08:42:21 -0000
From: "tip-bot2 for Jiri Olsa" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Linus Torvalds <torvalds@...ux-foundation.org>,
Jiri Olsa <jolsa@...nel.org>, "Peter Zijlstra (Intel)" <peterz@...radead.org>,
"Masami Hiramatsu (Google)" <mhiramat@...nel.org>,
Andrii Nakryiko <andrii@...nel.org>, Oleg Nesterov <oleg@...hat.com>,
x86@...nel.org, linux-kernel@...r.kernel.org
Subject: [tip: perf/urgent] uprobe: Move arch_uprobe_optimize right after
handlers execution
The following commit has been merged into the perf/urgent branch of tip:
Commit-ID: 62685ab071de7c39499212bff19f1b5bc0148bc7
Gitweb: https://git.kernel.org/tip/62685ab071de7c39499212bff19f1b5bc0148bc7
Author: Jiri Olsa <jolsa@...nel.org>
AuthorDate: Wed, 01 Oct 2025 15:24:49 +02:00
Committer: Peter Zijlstra <peterz@...radead.org>
CommitterDate: Tue, 14 Oct 2025 10:38:09 +02:00
uprobe: Move arch_uprobe_optimize right after handlers execution
It's less confusing to optimize uprobe right after handlers execution
and before we do the check for changed ip register to avoid situations
where changed ip register would skip uprobe optimization.
Suggested-by: Linus Torvalds <torvalds@...ux-foundation.org>
Signed-off-by: Jiri Olsa <jolsa@...nel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Reviewed-by: Masami Hiramatsu (Google) <mhiramat@...nel.org>
Acked-by: Andrii Nakryiko <andrii@...nel.org>
Acked-by: Oleg Nesterov <oleg@...hat.com>
---
kernel/events/uprobes.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c
index 8709c69..f11ceb8 100644
--- a/kernel/events/uprobes.c
+++ b/kernel/events/uprobes.c
@@ -2765,6 +2765,9 @@ static void handle_swbp(struct pt_regs *regs)
handler_chain(uprobe, regs);
+ /* Try to optimize after first hit. */
+ arch_uprobe_optimize(&uprobe->arch, bp_vaddr);
+
/*
* If user decided to take execution elsewhere, it makes little sense
* to execute the original instruction, so let's skip it.
@@ -2772,9 +2775,6 @@ static void handle_swbp(struct pt_regs *regs)
if (instruction_pointer(regs) != bp_vaddr)
goto out;
- /* Try to optimize after first hit. */
- arch_uprobe_optimize(&uprobe->arch, bp_vaddr);
-
if (arch_uprobe_skip_sstep(&uprobe->arch, regs))
goto out;
Powered by blists - more mailing lists