LKML Archive on
 help / color / Atom feed
From: tip-bot for Masami Hiramatsu <>
Subject: [tip:perf/core] kprobes/x86: Use preempt_enable() in optimized_callback()
Date: Sun, 21 Oct 2018 18:33:51 -0700
Message-ID: <> (raw)
In-Reply-To: <154002887331.7627.10194920925792947001.stgit@devbox>

Commit-ID:  2e62024c265aa69315ed02835623740030435380
Author:     Masami Hiramatsu <>
AuthorDate: Sat, 20 Oct 2018 18:47:53 +0900
Committer:  Ingo Molnar <>
CommitDate: Mon, 22 Oct 2018 03:31:01 +0200

kprobes/x86: Use preempt_enable() in optimized_callback()

The following commit:

  a19b2e3d7839 ("kprobes/x86: Remove IRQ disabling from ftrace-based/optimized kprobes”)

removed local_irq_save/restore() from optimized_callback(), the handler
might be interrupted by the rescheduling interrupt and might be
rescheduled - so we must not use the preempt_enable_no_resched() macro.

Use preempt_enable() instead, to not lose preemption events.

[ mingo: Improved the changelog. ]

Reported-by: Nadav Amit <>
Signed-off-by: Masami Hiramatsu <>
Acked-by: Peter Zijlstra (Intel) <>
Cc: <>
Cc: Alexei Starovoitov <>
Cc: Andy Lutomirski <>
Cc: Borislav Petkov <>
Cc: Linus Torvalds <>
Cc: Oleg Nesterov <>
Cc: Thomas Gleixner <>
Fixes: a19b2e3d7839 ("kprobes/x86: Remove IRQ disabling from ftrace-based/optimized kprobes”)
Signed-off-by: Ingo Molnar <>
 arch/x86/kernel/kprobes/opt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/kprobes/opt.c b/arch/x86/kernel/kprobes/opt.c
index eaf02f2e7300..40b16b270656 100644
--- a/arch/x86/kernel/kprobes/opt.c
+++ b/arch/x86/kernel/kprobes/opt.c
@@ -179,7 +179,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();
+	preempt_enable();

      parent reply index

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-20  9:47 [PATCH -tip] " Masami Hiramatsu
2018-10-21 20:42 ` Peter Zijlstra
2018-10-22  1:33 ` tip-bot for Masami Hiramatsu [this message]

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

LKML Archive on

Archives are clonable:
	git clone --mirror lkml/git/0.git
	git clone --mirror lkml/git/1.git
	git clone --mirror lkml/git/2.git
	git clone --mirror lkml/git/3.git
	git clone --mirror lkml/git/4.git
	git clone --mirror lkml/git/5.git
	git clone --mirror lkml/git/6.git
	git clone --mirror lkml/git/7.git
	git clone --mirror lkml/git/8.git
	git clone --mirror lkml/git/9.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ \
	public-inbox-index lkml

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone