diff options
author | Oleg Nesterov <oleg@redhat.com> | 2012-08-18 11:01:57 -0400 |
---|---|---|
committer | Oleg Nesterov <oleg@redhat.com> | 2012-09-15 11:37:26 -0400 |
commit | 6f47caa0e1e4887aa2ddca8388d058d35725d815 (patch) | |
tree | 2f88ea604c353b4a97006fbd220dceceb36e76f9 /kernel/events/uprobes.c | |
parent | 6d1d8dfa8b65831cfa9a528e3d17efa7e7f4226c (diff) |
uprobes: uprobes_treelock should not disable irqs
Nobody plays with uprobes_tree/uprobes_treelock in interrupt context,
no need to disable irqs.
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Diffstat (limited to 'kernel/events/uprobes.c')
-rw-r--r-- | kernel/events/uprobes.c | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c index 336f06948de1..ba9f1e7c6060 100644 --- a/kernel/events/uprobes.c +++ b/kernel/events/uprobes.c | |||
@@ -411,11 +411,10 @@ static struct uprobe *__find_uprobe(struct inode *inode, loff_t offset) | |||
411 | static struct uprobe *find_uprobe(struct inode *inode, loff_t offset) | 411 | static struct uprobe *find_uprobe(struct inode *inode, loff_t offset) |
412 | { | 412 | { |
413 | struct uprobe *uprobe; | 413 | struct uprobe *uprobe; |
414 | unsigned long flags; | ||
415 | 414 | ||
416 | spin_lock_irqsave(&uprobes_treelock, flags); | 415 | spin_lock(&uprobes_treelock); |
417 | uprobe = __find_uprobe(inode, offset); | 416 | uprobe = __find_uprobe(inode, offset); |
418 | spin_unlock_irqrestore(&uprobes_treelock, flags); | 417 | spin_unlock(&uprobes_treelock); |
419 | 418 | ||
420 | return uprobe; | 419 | return uprobe; |
421 | } | 420 | } |
@@ -462,12 +461,11 @@ static struct uprobe *__insert_uprobe(struct uprobe *uprobe) | |||
462 | */ | 461 | */ |
463 | static struct uprobe *insert_uprobe(struct uprobe *uprobe) | 462 | static struct uprobe *insert_uprobe(struct uprobe *uprobe) |
464 | { | 463 | { |
465 | unsigned long flags; | ||
466 | struct uprobe *u; | 464 | struct uprobe *u; |
467 | 465 | ||
468 | spin_lock_irqsave(&uprobes_treelock, flags); | 466 | spin_lock(&uprobes_treelock); |
469 | u = __insert_uprobe(uprobe); | 467 | u = __insert_uprobe(uprobe); |
470 | spin_unlock_irqrestore(&uprobes_treelock, flags); | 468 | spin_unlock(&uprobes_treelock); |
471 | 469 | ||
472 | /* For now assume that the instruction need not be single-stepped */ | 470 | /* For now assume that the instruction need not be single-stepped */ |
473 | uprobe->flags |= UPROBE_SKIP_SSTEP; | 471 | uprobe->flags |= UPROBE_SKIP_SSTEP; |
@@ -705,11 +703,9 @@ remove_breakpoint(struct uprobe *uprobe, struct mm_struct *mm, unsigned long vad | |||
705 | */ | 703 | */ |
706 | static void delete_uprobe(struct uprobe *uprobe) | 704 | static void delete_uprobe(struct uprobe *uprobe) |
707 | { | 705 | { |
708 | unsigned long flags; | 706 | spin_lock(&uprobes_treelock); |
709 | |||
710 | spin_lock_irqsave(&uprobes_treelock, flags); | ||
711 | rb_erase(&uprobe->rb_node, &uprobes_tree); | 707 | rb_erase(&uprobe->rb_node, &uprobes_tree); |
712 | spin_unlock_irqrestore(&uprobes_treelock, flags); | 708 | spin_unlock(&uprobes_treelock); |
713 | iput(uprobe->inode); | 709 | iput(uprobe->inode); |
714 | put_uprobe(uprobe); | 710 | put_uprobe(uprobe); |
715 | atomic_dec(&uprobe_events); | 711 | atomic_dec(&uprobe_events); |
@@ -968,7 +964,6 @@ static void build_probe_list(struct inode *inode, | |||
968 | struct list_head *head) | 964 | struct list_head *head) |
969 | { | 965 | { |
970 | loff_t min, max; | 966 | loff_t min, max; |
971 | unsigned long flags; | ||
972 | struct rb_node *n, *t; | 967 | struct rb_node *n, *t; |
973 | struct uprobe *u; | 968 | struct uprobe *u; |
974 | 969 | ||
@@ -976,7 +971,7 @@ static void build_probe_list(struct inode *inode, | |||
976 | min = vaddr_to_offset(vma, start); | 971 | min = vaddr_to_offset(vma, start); |
977 | max = min + (end - start) - 1; | 972 | max = min + (end - start) - 1; |
978 | 973 | ||
979 | spin_lock_irqsave(&uprobes_treelock, flags); | 974 | spin_lock(&uprobes_treelock); |
980 | n = find_node_in_range(inode, min, max); | 975 | n = find_node_in_range(inode, min, max); |
981 | if (n) { | 976 | if (n) { |
982 | for (t = n; t; t = rb_prev(t)) { | 977 | for (t = n; t; t = rb_prev(t)) { |
@@ -994,7 +989,7 @@ static void build_probe_list(struct inode *inode, | |||
994 | atomic_inc(&u->ref); | 989 | atomic_inc(&u->ref); |
995 | } | 990 | } |
996 | } | 991 | } |
997 | spin_unlock_irqrestore(&uprobes_treelock, flags); | 992 | spin_unlock(&uprobes_treelock); |
998 | } | 993 | } |
999 | 994 | ||
1000 | /* | 995 | /* |