Commit 6f47caa0e1e4887aa2ddca8388d058d35725d815
1 parent
6d1d8dfa8b
Exists in
smarc-l5.0.0_1.0.0-ga
and in
5 other branches
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>
Showing 1 changed file with 8 additions and 13 deletions Side-by-side Diff
kernel/events/uprobes.c
... | ... | @@ -411,11 +411,10 @@ |
411 | 411 | static struct uprobe *find_uprobe(struct inode *inode, loff_t offset) |
412 | 412 | { |
413 | 413 | struct uprobe *uprobe; |
414 | - unsigned long flags; | |
415 | 414 | |
416 | - spin_lock_irqsave(&uprobes_treelock, flags); | |
415 | + spin_lock(&uprobes_treelock); | |
417 | 416 | uprobe = __find_uprobe(inode, offset); |
418 | - spin_unlock_irqrestore(&uprobes_treelock, flags); | |
417 | + spin_unlock(&uprobes_treelock); | |
419 | 418 | |
420 | 419 | return uprobe; |
421 | 420 | } |
422 | 421 | |
423 | 422 | |
... | ... | @@ -462,12 +461,11 @@ |
462 | 461 | */ |
463 | 462 | static struct uprobe *insert_uprobe(struct uprobe *uprobe) |
464 | 463 | { |
465 | - unsigned long flags; | |
466 | 464 | struct uprobe *u; |
467 | 465 | |
468 | - spin_lock_irqsave(&uprobes_treelock, flags); | |
466 | + spin_lock(&uprobes_treelock); | |
469 | 467 | u = __insert_uprobe(uprobe); |
470 | - spin_unlock_irqrestore(&uprobes_treelock, flags); | |
468 | + spin_unlock(&uprobes_treelock); | |
471 | 469 | |
472 | 470 | /* For now assume that the instruction need not be single-stepped */ |
473 | 471 | uprobe->flags |= UPROBE_SKIP_SSTEP; |
474 | 472 | |
... | ... | @@ -705,11 +703,9 @@ |
705 | 703 | */ |
706 | 704 | static void delete_uprobe(struct uprobe *uprobe) |
707 | 705 | { |
708 | - unsigned long flags; | |
709 | - | |
710 | - spin_lock_irqsave(&uprobes_treelock, flags); | |
706 | + spin_lock(&uprobes_treelock); | |
711 | 707 | rb_erase(&uprobe->rb_node, &uprobes_tree); |
712 | - spin_unlock_irqrestore(&uprobes_treelock, flags); | |
708 | + spin_unlock(&uprobes_treelock); | |
713 | 709 | iput(uprobe->inode); |
714 | 710 | put_uprobe(uprobe); |
715 | 711 | atomic_dec(&uprobe_events); |
... | ... | @@ -968,7 +964,6 @@ |
968 | 964 | struct list_head *head) |
969 | 965 | { |
970 | 966 | loff_t min, max; |
971 | - unsigned long flags; | |
972 | 967 | struct rb_node *n, *t; |
973 | 968 | struct uprobe *u; |
974 | 969 | |
... | ... | @@ -976,7 +971,7 @@ |
976 | 971 | min = vaddr_to_offset(vma, start); |
977 | 972 | max = min + (end - start) - 1; |
978 | 973 | |
979 | - spin_lock_irqsave(&uprobes_treelock, flags); | |
974 | + spin_lock(&uprobes_treelock); | |
980 | 975 | n = find_node_in_range(inode, min, max); |
981 | 976 | if (n) { |
982 | 977 | for (t = n; t; t = rb_prev(t)) { |
... | ... | @@ -994,7 +989,7 @@ |
994 | 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 | /* |