Commit ae8b7ce7 authored by Paul E. McKenney's avatar Paul E. McKenney

kprobes: Replace synchronize_sched() with synchronize_rcu()

Now that synchronize_rcu() waits for preempt-disable regions of code
as well as RCU read-side critical sections, synchronize_sched() can be
replaced by synchronize_rcu().  This commit therefore makes this change.
Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.ibm.com>
Cc: "Naveen N. Rao" <naveen.n.rao@linux.ibm.com>
Cc: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
Cc: "David S. Miller" <davem@davemloft.net>
Acked-by: default avatarMasami Hiramatsu <mhiramat@kernel.org>
parent ba180314
...@@ -229,7 +229,7 @@ static int collect_garbage_slots(struct kprobe_insn_cache *c) ...@@ -229,7 +229,7 @@ static int collect_garbage_slots(struct kprobe_insn_cache *c)
struct kprobe_insn_page *kip, *next; struct kprobe_insn_page *kip, *next;
/* Ensure no-one is interrupted on the garbages */ /* Ensure no-one is interrupted on the garbages */
synchronize_sched(); synchronize_rcu();
list_for_each_entry_safe(kip, next, &c->pages, list) { list_for_each_entry_safe(kip, next, &c->pages, list) {
int i; int i;
...@@ -1382,7 +1382,7 @@ static int register_aggr_kprobe(struct kprobe *orig_p, struct kprobe *p) ...@@ -1382,7 +1382,7 @@ static int register_aggr_kprobe(struct kprobe *orig_p, struct kprobe *p)
if (ret) { if (ret) {
ap->flags |= KPROBE_FLAG_DISABLED; ap->flags |= KPROBE_FLAG_DISABLED;
list_del_rcu(&p->list); list_del_rcu(&p->list);
synchronize_sched(); synchronize_rcu();
} }
} }
} }
...@@ -1597,7 +1597,7 @@ int register_kprobe(struct kprobe *p) ...@@ -1597,7 +1597,7 @@ int register_kprobe(struct kprobe *p)
ret = arm_kprobe(p); ret = arm_kprobe(p);
if (ret) { if (ret) {
hlist_del_rcu(&p->hlist); hlist_del_rcu(&p->hlist);
synchronize_sched(); synchronize_rcu();
goto out; goto out;
} }
} }
...@@ -1776,7 +1776,7 @@ void unregister_kprobes(struct kprobe **kps, int num) ...@@ -1776,7 +1776,7 @@ void unregister_kprobes(struct kprobe **kps, int num)
kps[i]->addr = NULL; kps[i]->addr = NULL;
mutex_unlock(&kprobe_mutex); mutex_unlock(&kprobe_mutex);
synchronize_sched(); synchronize_rcu();
for (i = 0; i < num; i++) for (i = 0; i < num; i++)
if (kps[i]->addr) if (kps[i]->addr)
__unregister_kprobe_bottom(kps[i]); __unregister_kprobe_bottom(kps[i]);
...@@ -1966,7 +1966,7 @@ void unregister_kretprobes(struct kretprobe **rps, int num) ...@@ -1966,7 +1966,7 @@ void unregister_kretprobes(struct kretprobe **rps, int num)
rps[i]->kp.addr = NULL; rps[i]->kp.addr = NULL;
mutex_unlock(&kprobe_mutex); mutex_unlock(&kprobe_mutex);
synchronize_sched(); synchronize_rcu();
for (i = 0; i < num; i++) { for (i = 0; i < num; i++) {
if (rps[i]->kp.addr) { if (rps[i]->kp.addr) {
__unregister_kprobe_bottom(&rps[i]->kp); __unregister_kprobe_bottom(&rps[i]->kp);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment