From: Masami Hiramatsu <mhiramat@redhat.com>
To: Ingo Molnar <mingo@elte.hu>,
Ananth N Mavinakayanahalli <ananth@in.ibm.com>,
lkml <linux-kernel@vger.kernel.org>
Cc: systemtap <systemtap@sources.redhat.com>,
DLE <dle-develop@lists.sourceforge.net>,
Masami Hiramatsu <mhiramat@redhat.com>,
Ananth N Mavinakayanahalli <ananth@in.ibm.com>,
Ingo Molnar <mingo@elte.hu>, Jim Keniston <jkenisto@us.ibm.com>
Subject: [PATCH -tip 2/3] kprobes: no need to unlock kprobe_insn_mutex
Date: Tue, 30 Jun 2009 17:08:09 -0400 [thread overview]
Message-ID: <20090630210809.17851.28781.stgit@localhost.localdomain> (raw)
In-Reply-To: <20090630210757.17851.409.stgit@localhost.localdomain>
Remove needless kprobe_insn_mutex unlocking during safety check in garbage
collection, because if someone releases a dirty slot during safety check
(which ensures other cpus doesn't execute all dirty slots), the safety check
must be fail. So, we need to hold the mutex while checking safety.
Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Jim Keniston <jkenisto@us.ibm.com>
---
kernel/kprobes.c | 6 +-----
1 files changed, 1 insertions(+), 5 deletions(-)
diff --git a/kernel/kprobes.c b/kernel/kprobes.c
index c0fa54b..16b5739 100644
--- a/kernel/kprobes.c
+++ b/kernel/kprobes.c
@@ -237,13 +237,9 @@ static int __kprobes collect_garbage_slots(void)
{
struct kprobe_insn_page *kip;
struct hlist_node *pos, *next;
- int safety;
/* Ensure no-one is preepmted on the garbages */
- mutex_unlock(&kprobe_insn_mutex);
- safety = check_safety();
- mutex_lock(&kprobe_insn_mutex);
- if (safety != 0)
+ if (check_safety())
return -EAGAIN;
hlist_for_each_entry_safe(kip, pos, next, &kprobe_insn_pages, hlist) {
--
Masami Hiramatsu
Software Engineer
Hitachi Computer Products (America), Inc.
Software Solutions Division
e-mail: mhiramat@redhat.com
next prev parent reply other threads:[~2009-06-30 21:05 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-30 21:07 [PATCH -tip 0/3] kprobes: trivial bugfixes and cleanup Masami Hiramatsu
2009-06-30 21:08 ` [PATCH -tip 1/3] kprobes: fix kprobe selftest configuration dependency Masami Hiramatsu
2009-06-30 21:39 ` [tip:tracing/urgent] kprobes: Fix " tip-bot for Masami Hiramatsu
2009-06-30 21:08 ` Masami Hiramatsu [this message]
2009-06-30 21:40 ` [tip:tracing/urgent] kprobes: No need to unlock kprobe_insn_mutex tip-bot for Masami Hiramatsu
2009-07-01 8:47 ` [tip:tracing/core] " tip-bot for Masami Hiramatsu
2009-06-30 21:08 ` [PATCH -tip 3/3] kprobes: cleanup: use list instead of hlist for insn_pages Masami Hiramatsu
2009-06-30 21:25 ` Ingo Molnar
2009-06-30 21:47 ` Masami Hiramatsu
2009-06-30 21:50 ` Ingo Molnar
2009-06-30 23:12 ` Masami Hiramatsu
2009-06-30 23:18 ` Ingo Molnar
2009-06-30 23:27 ` [tip:tracing/core] kprobes: Clean up insn_pages by using list instead of hlist tip-bot for Masami Hiramatsu
2009-07-01 8:47 ` tip-bot for Masami Hiramatsu
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=20090630210809.17851.28781.stgit@localhost.localdomain \
--to=mhiramat@redhat.com \
--cc=ananth@in.ibm.com \
--cc=dle-develop@lists.sourceforge.net \
--cc=jkenisto@us.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=systemtap@sources.redhat.com \
/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