[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-9a09f261a4fa52de916b0db34a36956c95f78fdc@git.kernel.org>
Date: Thu, 28 Sep 2017 03:53:46 -0700
From: tip-bot for Masami Hiramatsu <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: mingo@...nel.org, ast@...com, mhiramat@...nel.org,
linux-kernel@...r.kernel.org, paulmck@...ux.vnet.ibm.com,
rostedt@...dmis.org, torvalds@...ux-foundation.org, ast@...nel.org,
peterz@...radead.org, hpa@...or.com, tglx@...utronix.de,
ananth@...ux.vnet.ibm.com
Subject: [tip:perf/core] kprobes/x86: Disable preemption in optprobe
Commit-ID: 9a09f261a4fa52de916b0db34a36956c95f78fdc
Gitweb: https://git.kernel.org/tip/9a09f261a4fa52de916b0db34a36956c95f78fdc
Author: Masami Hiramatsu <mhiramat@...nel.org>
AuthorDate: Tue, 19 Sep 2017 19:00:59 +0900
Committer: Ingo Molnar <mingo@...nel.org>
CommitDate: Thu, 28 Sep 2017 09:23:04 +0200
kprobes/x86: Disable preemption in optprobe
Disable preemption in optprobe handler as described
in Documentation/kprobes.txt, which says:
"Probe handlers are run with preemption disabled."
Signed-off-by: Masami Hiramatsu <mhiramat@...nel.org>
Cc: Alexei Starovoitov <ast@...com>
Cc: Alexei Starovoitov <ast@...nel.org>
Cc: Ananth N Mavinakayanahalli <ananth@...ux.vnet.ibm.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Paul E . McKenney <paulmck@...ux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Steven Rostedt <rostedt@...dmis.org>
Cc: Thomas Gleixner <tglx@...utronix.de>
Link: http://lkml.kernel.org/r/150581525942.32348.6359217983269060829.stgit@devbox
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
arch/x86/kernel/kprobes/opt.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/x86/kernel/kprobes/opt.c b/arch/x86/kernel/kprobes/opt.c
index f558103..32c35cb 100644
--- a/arch/x86/kernel/kprobes/opt.c
+++ b/arch/x86/kernel/kprobes/opt.c
@@ -161,6 +161,7 @@ optimized_callback(struct optimized_kprobe *op, struct pt_regs *regs)
return;
local_irq_save(flags);
+ preempt_disable();
if (kprobe_running()) {
kprobes_inc_nmissed_count(&op->kp);
} else {
@@ -180,6 +181,7 @@ optimized_callback(struct optimized_kprobe *op, struct pt_regs *regs)
opt_pre_handler(&op->kp, regs);
__this_cpu_write(current_kprobe, NULL);
}
+ preempt_enable_no_resched();
local_irq_restore(flags);
}
NOKPROBE_SYMBOL(optimized_callback);
Powered by blists - more mailing lists