diff options
author | Masami Hiramatsu <mhiramat@redhat.com> | 2009-06-30 17:08:09 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-07-01 10:43:07 +0200 |
commit | 4a2bb6fcc80e6330ca2f2393e98605052cc7780b (patch) | |
tree | 3e1d2314d7002f13bb61ff78266cce3922673c93 /kernel | |
parent | 238a24f626628cb16a3015f332d649f08246ca89 (diff) | |
download | linux-4a2bb6fcc80e6330ca2f2393e98605052cc7780b.tar.gz linux-4a2bb6fcc80e6330ca2f2393e98605052cc7780b.tar.bz2 linux-4a2bb6fcc80e6330ca2f2393e98605052cc7780b.zip |
kprobes: No need to unlock kprobe_insn_mutex
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: Jim Keniston <jkenisto@us.ibm.com>
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
LKML-Reference: <20090630210809.17851.28781.stgit@localhost.localdomain>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/kprobes.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/kernel/kprobes.c b/kernel/kprobes.c index c0fa54b276d9..16b5739c516a 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) { |