diff options
author | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2010-02-22 20:05:02 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-02-25 04:34:58 -0500 |
commit | 1304afb225288a2e250d6a7495462c28e5509cbb (patch) | |
tree | 1ba76e304f718f7ce89532e1c4d276b4af439c07 | |
parent | 20133cfce7d0bbdcc0c398301030c091f5675c88 (diff) |
rcu: Convert to raw_spinlocks
The spinlocks in rcutree need to be real spinlocks in
preempt-rt. Convert them to raw_spinlocks.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: laijs@cn.fujitsu.com
Cc: dipankar@in.ibm.com
Cc: mathieu.desnoyers@polymtl.ca
Cc: josh@joshtriplett.org
Cc: dvhltc@us.ibm.com
Cc: niv@us.ibm.com
Cc: peterz@infradead.org
Cc: rostedt@goodmis.org
Cc: Valdis.Kletnieks@vt.edu
Cc: dhowells@redhat.com
LKML-Reference: <1266887105-1528-18-git-send-email-paulmck@linux.vnet.ibm.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r-- | kernel/rcutree.c | 132 | ||||
-rw-r--r-- | kernel/rcutree.h | 6 | ||||
-rw-r--r-- | kernel/rcutree_plugin.h | 46 |
3 files changed, 92 insertions, 92 deletions
diff --git a/kernel/rcutree.c b/kernel/rcutree.c index dd0d31dffcdc..65a807b4f58c 100644 --- a/kernel/rcutree.c +++ b/kernel/rcutree.c | |||
@@ -66,11 +66,11 @@ static struct lock_class_key rcu_node_class[NUM_RCU_LVLS]; | |||
66 | .signaled = RCU_GP_IDLE, \ | 66 | .signaled = RCU_GP_IDLE, \ |
67 | .gpnum = -300, \ | 67 | .gpnum = -300, \ |
68 | .completed = -300, \ | 68 | .completed = -300, \ |
69 | .onofflock = __SPIN_LOCK_UNLOCKED(&name.onofflock), \ | 69 | .onofflock = __RAW_SPIN_LOCK_UNLOCKED(&name.onofflock), \ |
70 | .orphan_cbs_list = NULL, \ | 70 | .orphan_cbs_list = NULL, \ |
71 | .orphan_cbs_tail = &name.orphan_cbs_list, \ | 71 | .orphan_cbs_tail = &name.orphan_cbs_list, \ |
72 | .orphan_qlen = 0, \ | 72 | .orphan_qlen = 0, \ |
73 | .fqslock = __SPIN_LOCK_UNLOCKED(&name.fqslock), \ | 73 | .fqslock = __RAW_SPIN_LOCK_UNLOCKED(&name.fqslock), \ |
74 | .n_force_qs = 0, \ | 74 | .n_force_qs = 0, \ |
75 | .n_force_qs_ngp = 0, \ | 75 | .n_force_qs_ngp = 0, \ |
76 | } | 76 | } |
@@ -457,10 +457,10 @@ static void print_other_cpu_stall(struct rcu_state *rsp) | |||
457 | 457 | ||
458 | /* Only let one CPU complain about others per time interval. */ | 458 | /* Only let one CPU complain about others per time interval. */ |
459 | 459 | ||
460 | spin_lock_irqsave(&rnp->lock, flags); | 460 | raw_spin_lock_irqsave(&rnp->lock, flags); |
461 | delta = jiffies - rsp->jiffies_stall; | 461 | delta = jiffies - rsp->jiffies_stall; |
462 | if (delta < RCU_STALL_RAT_DELAY || !rcu_gp_in_progress(rsp)) { | 462 | if (delta < RCU_STALL_RAT_DELAY || !rcu_gp_in_progress(rsp)) { |
463 | spin_unlock_irqrestore(&rnp->lock, flags); | 463 | raw_spin_unlock_irqrestore(&rnp->lock, flags); |
464 | return; | 464 | return; |
465 | } | 465 | } |
466 | rsp->jiffies_stall = jiffies + RCU_SECONDS_TILL_STALL_RECHECK; | 466 | rsp->jiffies_stall = jiffies + RCU_SECONDS_TILL_STALL_RECHECK; |
@@ -470,7 +470,7 @@ static void print_other_cpu_stall(struct rcu_state *rsp) | |||
470 | * due to CPU offlining. | 470 | * due to CPU offlining. |
471 | */ | 471 | */ |
472 | rcu_print_task_stall(rnp); | 472 | rcu_print_task_stall(rnp); |
473 | spin_unlock_irqrestore(&rnp->lock, flags); | 473 | raw_spin_unlock_irqrestore(&rnp->lock, flags); |
474 | 474 | ||
475 | /* OK, time to rat on our buddy... */ | 475 | /* OK, time to rat on our buddy... */ |
476 | 476 | ||
@@ -499,11 +499,11 @@ static void print_cpu_stall(struct rcu_state *rsp) | |||
499 | smp_processor_id(), jiffies - rsp->gp_start); | 499 | smp_processor_id(), jiffies - rsp->gp_start); |
500 | trigger_all_cpu_backtrace(); | 500 | trigger_all_cpu_backtrace(); |
501 | 501 | ||
502 | spin_lock_irqsave(&rnp->lock, flags); | 502 | raw_spin_lock_irqsave(&rnp->lock, flags); |
503 | if (ULONG_CMP_GE(jiffies, rsp->jiffies_stall)) | 503 | if (ULONG_CMP_GE(jiffies, rsp->jiffies_stall)) |
504 | rsp->jiffies_stall = | 504 | rsp->jiffies_stall = |
505 | jiffies + RCU_SECONDS_TILL_STALL_RECHECK; | 505 | jiffies + RCU_SECONDS_TILL_STALL_RECHECK; |
506 | spin_unlock_irqrestore(&rnp->lock, flags); | 506 | raw_spin_unlock_irqrestore(&rnp->lock, flags); |
507 | 507 | ||
508 | set_need_resched(); /* kick ourselves to get things going. */ | 508 | set_need_resched(); /* kick ourselves to get things going. */ |
509 | } | 509 | } |
@@ -563,12 +563,12 @@ static void note_new_gpnum(struct rcu_state *rsp, struct rcu_data *rdp) | |||
563 | local_irq_save(flags); | 563 | local_irq_save(flags); |
564 | rnp = rdp->mynode; | 564 | rnp = rdp->mynode; |
565 | if (rdp->gpnum == ACCESS_ONCE(rnp->gpnum) || /* outside lock. */ | 565 | if (rdp->gpnum == ACCESS_ONCE(rnp->gpnum) || /* outside lock. */ |
566 | !spin_trylock(&rnp->lock)) { /* irqs already off, retry later. */ | 566 | !raw_spin_trylock(&rnp->lock)) { /* irqs already off, so later. */ |
567 | local_irq_restore(flags); | 567 | local_irq_restore(flags); |
568 | return; | 568 | return; |
569 | } | 569 | } |
570 | __note_new_gpnum(rsp, rnp, rdp); | 570 | __note_new_gpnum(rsp, rnp, rdp); |
571 | spin_unlock_irqrestore(&rnp->lock, flags); | 571 | raw_spin_unlock_irqrestore(&rnp->lock, flags); |
572 | } | 572 | } |
573 | 573 | ||
574 | /* | 574 | /* |
@@ -627,12 +627,12 @@ rcu_process_gp_end(struct rcu_state *rsp, struct rcu_data *rdp) | |||
627 | local_irq_save(flags); | 627 | local_irq_save(flags); |
628 | rnp = rdp->mynode; | 628 | rnp = rdp->mynode; |
629 | if (rdp->completed == ACCESS_ONCE(rnp->completed) || /* outside lock. */ | 629 | if (rdp->completed == ACCESS_ONCE(rnp->completed) || /* outside lock. */ |
630 | !spin_trylock(&rnp->lock)) { /* irqs already off, retry later. */ | 630 | !raw_spin_trylock(&rnp->lock)) { /* irqs already off, so later. */ |
631 | local_irq_restore(flags); | 631 | local_irq_restore(flags); |
632 | return; | 632 | return; |
633 | } | 633 | } |
634 | __rcu_process_gp_end(rsp, rnp, rdp); | 634 | __rcu_process_gp_end(rsp, rnp, rdp); |
635 | spin_unlock_irqrestore(&rnp->lock, flags); | 635 | raw_spin_unlock_irqrestore(&rnp->lock, flags); |
636 | } | 636 | } |
637 | 637 | ||
638 | /* | 638 | /* |
@@ -681,10 +681,10 @@ rcu_start_gp(struct rcu_state *rsp, unsigned long flags) | |||
681 | if (cpu_needs_another_gp(rsp, rdp)) | 681 | if (cpu_needs_another_gp(rsp, rdp)) |
682 | rsp->fqs_need_gp = 1; | 682 | rsp->fqs_need_gp = 1; |
683 | if (rnp->completed == rsp->completed) { | 683 | if (rnp->completed == rsp->completed) { |
684 | spin_unlock_irqrestore(&rnp->lock, flags); | 684 | raw_spin_unlock_irqrestore(&rnp->lock, flags); |
685 | return; | 685 | return; |
686 | } | 686 | } |
687 | spin_unlock(&rnp->lock); /* irqs remain disabled. */ | 687 | raw_spin_unlock(&rnp->lock); /* irqs remain disabled. */ |
688 | 688 | ||
689 | /* | 689 | /* |
690 | * Propagate new ->completed value to rcu_node structures | 690 | * Propagate new ->completed value to rcu_node structures |
@@ -692,9 +692,9 @@ rcu_start_gp(struct rcu_state *rsp, unsigned long flags) | |||
692 | * of the next grace period to process their callbacks. | 692 | * of the next grace period to process their callbacks. |
693 | */ | 693 | */ |
694 | rcu_for_each_node_breadth_first(rsp, rnp) { | 694 | rcu_for_each_node_breadth_first(rsp, rnp) { |
695 | spin_lock(&rnp->lock); /* irqs already disabled. */ | 695 | raw_spin_lock(&rnp->lock); /* irqs already disabled. */ |
696 | rnp->completed = rsp->completed; | 696 | rnp->completed = rsp->completed; |
697 | spin_unlock(&rnp->lock); /* irqs remain disabled. */ | 697 | raw_spin_unlock(&rnp->lock); /* irqs remain disabled. */ |
698 | } | 698 | } |
699 | local_irq_restore(flags); | 699 | local_irq_restore(flags); |
700 | return; | 700 | return; |
@@ -715,15 +715,15 @@ rcu_start_gp(struct rcu_state *rsp, unsigned long flags) | |||
715 | rnp->completed = rsp->completed; | 715 | rnp->completed = rsp->completed; |
716 | rsp->signaled = RCU_SIGNAL_INIT; /* force_quiescent_state OK. */ | 716 | rsp->signaled = RCU_SIGNAL_INIT; /* force_quiescent_state OK. */ |
717 | rcu_start_gp_per_cpu(rsp, rnp, rdp); | 717 | rcu_start_gp_per_cpu(rsp, rnp, rdp); |
718 | spin_unlock_irqrestore(&rnp->lock, flags); | 718 | raw_spin_unlock_irqrestore(&rnp->lock, flags); |
719 | return; | 719 | return; |
720 | } | 720 | } |
721 | 721 | ||
722 | spin_unlock(&rnp->lock); /* leave irqs disabled. */ | 722 | raw_spin_unlock(&rnp->lock); /* leave irqs disabled. */ |
723 | 723 | ||
724 | 724 | ||
725 | /* Exclude any concurrent CPU-hotplug operations. */ | 725 | /* Exclude any concurrent CPU-hotplug operations. */ |
726 | spin_lock(&rsp->onofflock); /* irqs already disabled. */ | 726 | raw_spin_lock(&rsp->onofflock); /* irqs already disabled. */ |
727 | 727 | ||
728 | /* | 728 | /* |
729 | * Set the quiescent-state-needed bits in all the rcu_node | 729 | * Set the quiescent-state-needed bits in all the rcu_node |
@@ -743,21 +743,21 @@ rcu_start_gp(struct rcu_state *rsp, unsigned long flags) | |||
743 | * irqs disabled. | 743 | * irqs disabled. |
744 | */ | 744 | */ |
745 | rcu_for_each_node_breadth_first(rsp, rnp) { | 745 | rcu_for_each_node_breadth_first(rsp, rnp) { |
746 | spin_lock(&rnp->lock); /* irqs already disabled. */ | 746 | raw_spin_lock(&rnp->lock); /* irqs already disabled. */ |
747 | rcu_preempt_check_blocked_tasks(rnp); | 747 | rcu_preempt_check_blocked_tasks(rnp); |
748 | rnp->qsmask = rnp->qsmaskinit; | 748 | rnp->qsmask = rnp->qsmaskinit; |
749 | rnp->gpnum = rsp->gpnum; | 749 | rnp->gpnum = rsp->gpnum; |
750 | rnp->completed = rsp->completed; | 750 | rnp->completed = rsp->completed; |
751 | if (rnp == rdp->mynode) | 751 | if (rnp == rdp->mynode) |
752 | rcu_start_gp_per_cpu(rsp, rnp, rdp); | 752 | rcu_start_gp_per_cpu(rsp, rnp, rdp); |
753 | spin_unlock(&rnp->lock); /* irqs remain disabled. */ | 753 | raw_spin_unlock(&rnp->lock); /* irqs remain disabled. */ |
754 | } | 754 | } |
755 | 755 | ||
756 | rnp = rcu_get_root(rsp); | 756 | rnp = rcu_get_root(rsp); |
757 | spin_lock(&rnp->lock); /* irqs already disabled. */ | 757 | raw_spin_lock(&rnp->lock); /* irqs already disabled. */ |
758 | rsp->signaled = RCU_SIGNAL_INIT; /* force_quiescent_state now OK. */ | 758 | rsp->signaled = RCU_SIGNAL_INIT; /* force_quiescent_state now OK. */ |
759 | spin_unlock(&rnp->lock); /* irqs remain disabled. */ | 759 | raw_spin_unlock(&rnp->lock); /* irqs remain disabled. */ |
760 | spin_unlock_irqrestore(&rsp->onofflock, flags); | 760 | raw_spin_unlock_irqrestore(&rsp->onofflock, flags); |
761 | } | 761 | } |
762 | 762 | ||
763 | /* | 763 | /* |
@@ -796,14 +796,14 @@ rcu_report_qs_rnp(unsigned long mask, struct rcu_state *rsp, | |||
796 | if (!(rnp->qsmask & mask)) { | 796 | if (!(rnp->qsmask & mask)) { |
797 | 797 | ||
798 | /* Our bit has already been cleared, so done. */ | 798 | /* Our bit has already been cleared, so done. */ |
799 | spin_unlock_irqrestore(&rnp->lock, flags); | 799 | raw_spin_unlock_irqrestore(&rnp->lock, flags); |
800 | return; | 800 | return; |
801 | } | 801 | } |
802 | rnp->qsmask &= ~mask; | 802 | rnp->qsmask &= ~mask; |
803 | if (rnp->qsmask != 0 || rcu_preempted_readers(rnp)) { | 803 | if (rnp->qsmask != 0 || rcu_preempted_readers(rnp)) { |
804 | 804 | ||
805 | /* Other bits still set at this level, so done. */ | 805 | /* Other bits still set at this level, so done. */ |
806 | spin_unlock_irqrestore(&rnp->lock, flags); | 806 | raw_spin_unlock_irqrestore(&rnp->lock, flags); |
807 | return; | 807 | return; |
808 | } | 808 | } |
809 | mask = rnp->grpmask; | 809 | mask = rnp->grpmask; |
@@ -813,10 +813,10 @@ rcu_report_qs_rnp(unsigned long mask, struct rcu_state *rsp, | |||
813 | 813 | ||
814 | break; | 814 | break; |
815 | } | 815 | } |
816 | spin_unlock_irqrestore(&rnp->lock, flags); | 816 | raw_spin_unlock_irqrestore(&rnp->lock, flags); |
817 | rnp_c = rnp; | 817 | rnp_c = rnp; |
818 | rnp = rnp->parent; | 818 | rnp = rnp->parent; |
819 | spin_lock_irqsave(&rnp->lock, flags); | 819 | raw_spin_lock_irqsave(&rnp->lock, flags); |
820 | WARN_ON_ONCE(rnp_c->qsmask); | 820 | WARN_ON_ONCE(rnp_c->qsmask); |
821 | } | 821 | } |
822 | 822 | ||
@@ -845,7 +845,7 @@ rcu_report_qs_rdp(int cpu, struct rcu_state *rsp, struct rcu_data *rdp, long las | |||
845 | struct rcu_node *rnp; | 845 | struct rcu_node *rnp; |
846 | 846 | ||
847 | rnp = rdp->mynode; | 847 | rnp = rdp->mynode; |
848 | spin_lock_irqsave(&rnp->lock, flags); | 848 | raw_spin_lock_irqsave(&rnp->lock, flags); |
849 | if (lastcomp != rnp->completed) { | 849 | if (lastcomp != rnp->completed) { |
850 | 850 | ||
851 | /* | 851 | /* |
@@ -857,12 +857,12 @@ rcu_report_qs_rdp(int cpu, struct rcu_state *rsp, struct rcu_data *rdp, long las | |||
857 | * race occurred. | 857 | * race occurred. |
858 | */ | 858 | */ |
859 | rdp->passed_quiesc = 0; /* try again later! */ | 859 | rdp->passed_quiesc = 0; /* try again later! */ |
860 | spin_unlock_irqrestore(&rnp->lock, flags); | 860 | raw_spin_unlock_irqrestore(&rnp->lock, flags); |
861 | return; | 861 | return; |
862 | } | 862 | } |
863 | mask = rdp->grpmask; | 863 | mask = rdp->grpmask; |
864 | if ((rnp->qsmask & mask) == 0) { | 864 | if ((rnp->qsmask & mask) == 0) { |
865 | spin_unlock_irqrestore(&rnp->lock, flags); | 865 | raw_spin_unlock_irqrestore(&rnp->lock, flags); |
866 | } else { | 866 | } else { |
867 | rdp->qs_pending = 0; | 867 | rdp->qs_pending = 0; |
868 | 868 | ||
@@ -926,7 +926,7 @@ static void rcu_send_cbs_to_orphanage(struct rcu_state *rsp) | |||
926 | 926 | ||
927 | if (rdp->nxtlist == NULL) | 927 | if (rdp->nxtlist == NULL) |
928 | return; /* irqs disabled, so comparison is stable. */ | 928 | return; /* irqs disabled, so comparison is stable. */ |
929 | spin_lock(&rsp->onofflock); /* irqs already disabled. */ | 929 | raw_spin_lock(&rsp->onofflock); /* irqs already disabled. */ |
930 | *rsp->orphan_cbs_tail = rdp->nxtlist; | 930 | *rsp->orphan_cbs_tail = rdp->nxtlist; |
931 | rsp->orphan_cbs_tail = rdp->nxttail[RCU_NEXT_TAIL]; | 931 | rsp->orphan_cbs_tail = rdp->nxttail[RCU_NEXT_TAIL]; |
932 | rdp->nxtlist = NULL; | 932 | rdp->nxtlist = NULL; |
@@ -934,7 +934,7 @@ static void rcu_send_cbs_to_orphanage(struct rcu_state *rsp) | |||
934 | rdp->nxttail[i] = &rdp->nxtlist; | 934 | rdp->nxttail[i] = &rdp->nxtlist; |
935 | rsp->orphan_qlen += rdp->qlen; | 935 | rsp->orphan_qlen += rdp->qlen; |
936 | rdp->qlen = 0; | 936 | rdp->qlen = 0; |
937 | spin_unlock(&rsp->onofflock); /* irqs remain disabled. */ | 937 | raw_spin_unlock(&rsp->onofflock); /* irqs remain disabled. */ |
938 | } | 938 | } |
939 | 939 | ||
940 | /* | 940 | /* |
@@ -945,10 +945,10 @@ static void rcu_adopt_orphan_cbs(struct rcu_state *rsp) | |||
945 | unsigned long flags; | 945 | unsigned long flags; |
946 | struct rcu_data *rdp; | 946 | struct rcu_data *rdp; |
947 | 947 | ||
948 | spin_lock_irqsave(&rsp->onofflock, flags); | 948 | raw_spin_lock_irqsave(&rsp->onofflock, flags); |
949 | rdp = rsp->rda[smp_processor_id()]; | 949 | rdp = rsp->rda[smp_processor_id()]; |
950 | if (rsp->orphan_cbs_list == NULL) { | 950 | if (rsp->orphan_cbs_list == NULL) { |
951 | spin_unlock_irqrestore(&rsp->onofflock, flags); | 951 | raw_spin_unlock_irqrestore(&rsp->onofflock, flags); |
952 | return; | 952 | return; |
953 | } | 953 | } |
954 | *rdp->nxttail[RCU_NEXT_TAIL] = rsp->orphan_cbs_list; | 954 | *rdp->nxttail[RCU_NEXT_TAIL] = rsp->orphan_cbs_list; |
@@ -957,7 +957,7 @@ static void rcu_adopt_orphan_cbs(struct rcu_state *rsp) | |||
957 | rsp->orphan_cbs_list = NULL; | 957 | rsp->orphan_cbs_list = NULL; |
958 | rsp->orphan_cbs_tail = &rsp->orphan_cbs_list; | 958 | rsp->orphan_cbs_tail = &rsp->orphan_cbs_list; |
959 | rsp->orphan_qlen = 0; | 959 | rsp->orphan_qlen = 0; |
960 | spin_unlock_irqrestore(&rsp->onofflock, flags); | 960 | raw_spin_unlock_irqrestore(&rsp->onofflock, flags); |
961 | } | 961 | } |
962 | 962 | ||
963 | /* | 963 | /* |
@@ -973,23 +973,23 @@ static void __rcu_offline_cpu(int cpu, struct rcu_state *rsp) | |||
973 | struct rcu_node *rnp; | 973 | struct rcu_node *rnp; |
974 | 974 | ||
975 | /* Exclude any attempts to start a new grace period. */ | 975 | /* Exclude any attempts to start a new grace period. */ |
976 | spin_lock_irqsave(&rsp->onofflock, flags); | 976 | raw_spin_lock_irqsave(&rsp->onofflock, flags); |
977 | 977 | ||
978 | /* Remove the outgoing CPU from the masks in the rcu_node hierarchy. */ | 978 | /* Remove the outgoing CPU from the masks in the rcu_node hierarchy. */ |
979 | rnp = rdp->mynode; /* this is the outgoing CPU's rnp. */ | 979 | rnp = rdp->mynode; /* this is the outgoing CPU's rnp. */ |
980 | mask = rdp->grpmask; /* rnp->grplo is constant. */ | 980 | mask = rdp->grpmask; /* rnp->grplo is constant. */ |
981 | do { | 981 | do { |
982 | spin_lock(&rnp->lock); /* irqs already disabled. */ | 982 | raw_spin_lock(&rnp->lock); /* irqs already disabled. */ |
983 | rnp->qsmaskinit &= ~mask; | 983 | rnp->qsmaskinit &= ~mask; |
984 | if (rnp->qsmaskinit != 0) { | 984 | if (rnp->qsmaskinit != 0) { |
985 | if (rnp != rdp->mynode) | 985 | if (rnp != rdp->mynode) |
986 | spin_unlock(&rnp->lock); /* irqs remain disabled. */ | 986 | raw_spin_unlock(&rnp->lock); /* irqs remain disabled. */ |
987 | break; | 987 | break; |
988 | } | 988 | } |
989 | if (rnp == rdp->mynode) | 989 | if (rnp == rdp->mynode) |
990 | need_report = rcu_preempt_offline_tasks(rsp, rnp, rdp); | 990 | need_report = rcu_preempt_offline_tasks(rsp, rnp, rdp); |
991 | else | 991 | else |
992 | spin_unlock(&rnp->lock); /* irqs remain disabled. */ | 992 | raw_spin_unlock(&rnp->lock); /* irqs remain disabled. */ |
993 | mask = rnp->grpmask; | 993 | mask = rnp->grpmask; |
994 | rnp = rnp->parent; | 994 | rnp = rnp->parent; |
995 | } while (rnp != NULL); | 995 | } while (rnp != NULL); |
@@ -1000,12 +1000,12 @@ static void __rcu_offline_cpu(int cpu, struct rcu_state *rsp) | |||
1000 | * because invoking rcu_report_unblock_qs_rnp() with ->onofflock | 1000 | * because invoking rcu_report_unblock_qs_rnp() with ->onofflock |
1001 | * held leads to deadlock. | 1001 | * held leads to deadlock. |
1002 | */ | 1002 | */ |
1003 | spin_unlock(&rsp->onofflock); /* irqs remain disabled. */ | 1003 | raw_spin_unlock(&rsp->onofflock); /* irqs remain disabled. */ |
1004 | rnp = rdp->mynode; | 1004 | rnp = rdp->mynode; |
1005 | if (need_report & RCU_OFL_TASKS_NORM_GP) | 1005 | if (need_report & RCU_OFL_TASKS_NORM_GP) |
1006 | rcu_report_unblock_qs_rnp(rnp, flags); | 1006 | rcu_report_unblock_qs_rnp(rnp, flags); |
1007 | else | 1007 | else |
1008 | spin_unlock_irqrestore(&rnp->lock, flags); | 1008 | raw_spin_unlock_irqrestore(&rnp->lock, flags); |
1009 | if (need_report & RCU_OFL_TASKS_EXP_GP) | 1009 | if (need_report & RCU_OFL_TASKS_EXP_GP) |
1010 | rcu_report_exp_rnp(rsp, rnp); | 1010 | rcu_report_exp_rnp(rsp, rnp); |
1011 | 1011 | ||
@@ -1176,13 +1176,13 @@ static void force_qs_rnp(struct rcu_state *rsp, int (*f)(struct rcu_data *)) | |||
1176 | 1176 | ||
1177 | rcu_for_each_leaf_node(rsp, rnp) { | 1177 | rcu_for_each_leaf_node(rsp, rnp) { |
1178 | mask = 0; | 1178 | mask = 0; |
1179 | spin_lock_irqsave(&rnp->lock, flags); | 1179 | raw_spin_lock_irqsave(&rnp->lock, flags); |
1180 | if (!rcu_gp_in_progress(rsp)) { | 1180 | if (!rcu_gp_in_progress(rsp)) { |
1181 | spin_unlock_irqrestore(&rnp->lock, flags); | 1181 | raw_spin_unlock_irqrestore(&rnp->lock, flags); |
1182 | return; | 1182 | return; |
1183 | } | 1183 | } |
1184 | if (rnp->qsmask == 0) { | 1184 | if (rnp->qsmask == 0) { |
1185 | spin_unlock_irqrestore(&rnp->lock, flags); | 1185 | raw_spin_unlock_irqrestore(&rnp->lock, flags); |
1186 | continue; | 1186 | continue; |
1187 | } | 1187 | } |
1188 | cpu = rnp->grplo; | 1188 | cpu = rnp->grplo; |
@@ -1197,7 +1197,7 @@ static void force_qs_rnp(struct rcu_state *rsp, int (*f)(struct rcu_data *)) | |||
1197 | rcu_report_qs_rnp(mask, rsp, rnp, flags); | 1197 | rcu_report_qs_rnp(mask, rsp, rnp, flags); |
1198 | continue; | 1198 | continue; |
1199 | } | 1199 | } |
1200 | spin_unlock_irqrestore(&rnp->lock, flags); | 1200 | raw_spin_unlock_irqrestore(&rnp->lock, flags); |
1201 | } | 1201 | } |
1202 | } | 1202 | } |
1203 | 1203 | ||
@@ -1212,18 +1212,18 @@ static void force_quiescent_state(struct rcu_state *rsp, int relaxed) | |||
1212 | 1212 | ||
1213 | if (!rcu_gp_in_progress(rsp)) | 1213 | if (!rcu_gp_in_progress(rsp)) |
1214 | return; /* No grace period in progress, nothing to force. */ | 1214 | return; /* No grace period in progress, nothing to force. */ |
1215 | if (!spin_trylock_irqsave(&rsp->fqslock, flags)) { | 1215 | if (!raw_spin_trylock_irqsave(&rsp->fqslock, flags)) { |
1216 | rsp->n_force_qs_lh++; /* Inexact, can lose counts. Tough! */ | 1216 | rsp->n_force_qs_lh++; /* Inexact, can lose counts. Tough! */ |
1217 | return; /* Someone else is already on the job. */ | 1217 | return; /* Someone else is already on the job. */ |
1218 | } | 1218 | } |
1219 | if (relaxed && ULONG_CMP_GE(rsp->jiffies_force_qs, jiffies)) | 1219 | if (relaxed && ULONG_CMP_GE(rsp->jiffies_force_qs, jiffies)) |
1220 | goto unlock_fqs_ret; /* no emergency and done recently. */ | 1220 | goto unlock_fqs_ret; /* no emergency and done recently. */ |
1221 | rsp->n_force_qs++; | 1221 | rsp->n_force_qs++; |
1222 | spin_lock(&rnp->lock); /* irqs already disabled */ | 1222 | raw_spin_lock(&rnp->lock); /* irqs already disabled */ |
1223 | rsp->jiffies_force_qs = jiffies + RCU_JIFFIES_TILL_FORCE_QS; | 1223 | rsp->jiffies_force_qs = jiffies + RCU_JIFFIES_TILL_FORCE_QS; |
1224 | if(!rcu_gp_in_progress(rsp)) { | 1224 | if(!rcu_gp_in_progress(rsp)) { |
1225 | rsp->n_force_qs_ngp++; | 1225 | rsp->n_force_qs_ngp++; |
1226 | spin_unlock(&rnp->lock); /* irqs remain disabled */ | 1226 | raw_spin_unlock(&rnp->lock); /* irqs remain disabled */ |
1227 | goto unlock_fqs_ret; /* no GP in progress, time updated. */ | 1227 | goto unlock_fqs_ret; /* no GP in progress, time updated. */ |
1228 | } | 1228 | } |
1229 | rsp->fqs_active = 1; | 1229 | rsp->fqs_active = 1; |
@@ -1235,13 +1235,13 @@ static void force_quiescent_state(struct rcu_state *rsp, int relaxed) | |||
1235 | 1235 | ||
1236 | case RCU_SAVE_DYNTICK: | 1236 | case RCU_SAVE_DYNTICK: |
1237 | 1237 | ||
1238 | spin_unlock(&rnp->lock); /* irqs remain disabled */ | 1238 | raw_spin_unlock(&rnp->lock); /* irqs remain disabled */ |
1239 | if (RCU_SIGNAL_INIT != RCU_SAVE_DYNTICK) | 1239 | if (RCU_SIGNAL_INIT != RCU_SAVE_DYNTICK) |
1240 | break; /* So gcc recognizes the dead code. */ | 1240 | break; /* So gcc recognizes the dead code. */ |
1241 | 1241 | ||
1242 | /* Record dyntick-idle state. */ | 1242 | /* Record dyntick-idle state. */ |
1243 | force_qs_rnp(rsp, dyntick_save_progress_counter); | 1243 | force_qs_rnp(rsp, dyntick_save_progress_counter); |
1244 | spin_lock(&rnp->lock); /* irqs already disabled */ | 1244 | raw_spin_lock(&rnp->lock); /* irqs already disabled */ |
1245 | if (rcu_gp_in_progress(rsp)) | 1245 | if (rcu_gp_in_progress(rsp)) |
1246 | rsp->signaled = RCU_FORCE_QS; | 1246 | rsp->signaled = RCU_FORCE_QS; |
1247 | break; | 1247 | break; |
@@ -1249,24 +1249,24 @@ static void force_quiescent_state(struct rcu_state *rsp, int relaxed) | |||
1249 | case RCU_FORCE_QS: | 1249 | case RCU_FORCE_QS: |
1250 | 1250 | ||
1251 | /* Check dyntick-idle state, send IPI to laggarts. */ | 1251 | /* Check dyntick-idle state, send IPI to laggarts. */ |
1252 | spin_unlock(&rnp->lock); /* irqs remain disabled */ | 1252 | raw_spin_unlock(&rnp->lock); /* irqs remain disabled */ |
1253 | force_qs_rnp(rsp, rcu_implicit_dynticks_qs); | 1253 | force_qs_rnp(rsp, rcu_implicit_dynticks_qs); |
1254 | 1254 | ||
1255 | /* Leave state in case more forcing is required. */ | 1255 | /* Leave state in case more forcing is required. */ |
1256 | 1256 | ||
1257 | spin_lock(&rnp->lock); /* irqs already disabled */ | 1257 | raw_spin_lock(&rnp->lock); /* irqs already disabled */ |
1258 | break; | 1258 | break; |
1259 | } | 1259 | } |
1260 | rsp->fqs_active = 0; | 1260 | rsp->fqs_active = 0; |
1261 | if (rsp->fqs_need_gp) { | 1261 | if (rsp->fqs_need_gp) { |
1262 | spin_unlock(&rsp->fqslock); /* irqs remain disabled */ | 1262 | raw_spin_unlock(&rsp->fqslock); /* irqs remain disabled */ |
1263 | rsp->fqs_need_gp = 0; | 1263 | rsp->fqs_need_gp = 0; |
1264 | rcu_start_gp(rsp, flags); /* releases rnp->lock */ | 1264 | rcu_start_gp(rsp, flags); /* releases rnp->lock */ |
1265 | return; | 1265 | return; |
1266 | } | 1266 | } |
1267 | spin_unlock(&rnp->lock); /* irqs remain disabled */ | 1267 | raw_spin_unlock(&rnp->lock); /* irqs remain disabled */ |
1268 | unlock_fqs_ret: | 1268 | unlock_fqs_ret: |
1269 | spin_unlock_irqrestore(&rsp->fqslock, flags); | 1269 | raw_spin_unlock_irqrestore(&rsp->fqslock, flags); |
1270 | } | 1270 | } |
1271 | 1271 | ||
1272 | #else /* #ifdef CONFIG_SMP */ | 1272 | #else /* #ifdef CONFIG_SMP */ |
@@ -1308,7 +1308,7 @@ __rcu_process_callbacks(struct rcu_state *rsp, struct rcu_data *rdp) | |||
1308 | 1308 | ||
1309 | /* Does this CPU require a not-yet-started grace period? */ | 1309 | /* Does this CPU require a not-yet-started grace period? */ |
1310 | if (cpu_needs_another_gp(rsp, rdp)) { | 1310 | if (cpu_needs_another_gp(rsp, rdp)) { |
1311 | spin_lock_irqsave(&rcu_get_root(rsp)->lock, flags); | 1311 | raw_spin_lock_irqsave(&rcu_get_root(rsp)->lock, flags); |
1312 | rcu_start_gp(rsp, flags); /* releases above lock */ | 1312 | rcu_start_gp(rsp, flags); /* releases above lock */ |
1313 | } | 1313 | } |
1314 | 1314 | ||
@@ -1373,7 +1373,7 @@ __call_rcu(struct rcu_head *head, void (*func)(struct rcu_head *rcu), | |||
1373 | unsigned long nestflag; | 1373 | unsigned long nestflag; |
1374 | struct rcu_node *rnp_root = rcu_get_root(rsp); | 1374 | struct rcu_node *rnp_root = rcu_get_root(rsp); |
1375 | 1375 | ||
1376 | spin_lock_irqsave(&rnp_root->lock, nestflag); | 1376 | raw_spin_lock_irqsave(&rnp_root->lock, nestflag); |
1377 | rcu_start_gp(rsp, nestflag); /* releases rnp_root->lock. */ | 1377 | rcu_start_gp(rsp, nestflag); /* releases rnp_root->lock. */ |
1378 | } | 1378 | } |
1379 | 1379 | ||
@@ -1662,7 +1662,7 @@ rcu_boot_init_percpu_data(int cpu, struct rcu_state *rsp) | |||
1662 | struct rcu_node *rnp = rcu_get_root(rsp); | 1662 | struct rcu_node *rnp = rcu_get_root(rsp); |
1663 | 1663 | ||
1664 | /* Set up local state, ensuring consistent view of global state. */ | 1664 | /* Set up local state, ensuring consistent view of global state. */ |
1665 | spin_lock_irqsave(&rnp->lock, flags); | 1665 | raw_spin_lock_irqsave(&rnp->lock, flags); |
1666 | rdp->grpmask = 1UL << (cpu - rdp->mynode->grplo); | 1666 | rdp->grpmask = 1UL << (cpu - rdp->mynode->grplo); |
1667 | rdp->nxtlist = NULL; | 1667 | rdp->nxtlist = NULL; |
1668 | for (i = 0; i < RCU_NEXT_SIZE; i++) | 1668 | for (i = 0; i < RCU_NEXT_SIZE; i++) |
@@ -1672,7 +1672,7 @@ rcu_boot_init_percpu_data(int cpu, struct rcu_state *rsp) | |||
1672 | rdp->dynticks = &per_cpu(rcu_dynticks, cpu); | 1672 | rdp->dynticks = &per_cpu(rcu_dynticks, cpu); |
1673 | #endif /* #ifdef CONFIG_NO_HZ */ | 1673 | #endif /* #ifdef CONFIG_NO_HZ */ |
1674 | rdp->cpu = cpu; | 1674 | rdp->cpu = cpu; |
1675 | spin_unlock_irqrestore(&rnp->lock, flags); | 1675 | raw_spin_unlock_irqrestore(&rnp->lock, flags); |
1676 | } | 1676 | } |
1677 | 1677 | ||
1678 | /* | 1678 | /* |
@@ -1690,7 +1690,7 @@ rcu_init_percpu_data(int cpu, struct rcu_state *rsp, int preemptable) | |||
1690 | struct rcu_node *rnp = rcu_get_root(rsp); | 1690 | struct rcu_node *rnp = rcu_get_root(rsp); |
1691 | 1691 | ||
1692 | /* Set up local state, ensuring consistent view of global state. */ | 1692 | /* Set up local state, ensuring consistent view of global state. */ |
1693 | spin_lock_irqsave(&rnp->lock, flags); | 1693 | raw_spin_lock_irqsave(&rnp->lock, flags); |
1694 | rdp->passed_quiesc = 0; /* We could be racing with new GP, */ | 1694 | rdp->passed_quiesc = 0; /* We could be racing with new GP, */ |
1695 | rdp->qs_pending = 1; /* so set up to respond to current GP. */ | 1695 | rdp->qs_pending = 1; /* so set up to respond to current GP. */ |
1696 | rdp->beenonline = 1; /* We have now been online. */ | 1696 | rdp->beenonline = 1; /* We have now been online. */ |
@@ -1698,7 +1698,7 @@ rcu_init_percpu_data(int cpu, struct rcu_state *rsp, int preemptable) | |||
1698 | rdp->qlen_last_fqs_check = 0; | 1698 | rdp->qlen_last_fqs_check = 0; |
1699 | rdp->n_force_qs_snap = rsp->n_force_qs; | 1699 | rdp->n_force_qs_snap = rsp->n_force_qs; |
1700 | rdp->blimit = blimit; | 1700 | rdp->blimit = blimit; |
1701 | spin_unlock(&rnp->lock); /* irqs remain disabled. */ | 1701 | raw_spin_unlock(&rnp->lock); /* irqs remain disabled. */ |
1702 | 1702 | ||
1703 | /* | 1703 | /* |
1704 | * A new grace period might start here. If so, we won't be part | 1704 | * A new grace period might start here. If so, we won't be part |
@@ -1706,14 +1706,14 @@ rcu_init_percpu_data(int cpu, struct rcu_state *rsp, int preemptable) | |||
1706 | */ | 1706 | */ |
1707 | 1707 | ||
1708 | /* Exclude any attempts to start a new GP on large systems. */ | 1708 | /* Exclude any attempts to start a new GP on large systems. */ |
1709 | spin_lock(&rsp->onofflock); /* irqs already disabled. */ | 1709 | raw_spin_lock(&rsp->onofflock); /* irqs already disabled. */ |
1710 | 1710 | ||
1711 | /* Add CPU to rcu_node bitmasks. */ | 1711 | /* Add CPU to rcu_node bitmasks. */ |
1712 | rnp = rdp->mynode; | 1712 | rnp = rdp->mynode; |
1713 | mask = rdp->grpmask; | 1713 | mask = rdp->grpmask; |
1714 | do { | 1714 | do { |
1715 | /* Exclude any attempts to start a new GP on small systems. */ | 1715 | /* Exclude any attempts to start a new GP on small systems. */ |
1716 | spin_lock(&rnp->lock); /* irqs already disabled. */ | 1716 | raw_spin_lock(&rnp->lock); /* irqs already disabled. */ |
1717 | rnp->qsmaskinit |= mask; | 1717 | rnp->qsmaskinit |= mask; |
1718 | mask = rnp->grpmask; | 1718 | mask = rnp->grpmask; |
1719 | if (rnp == rdp->mynode) { | 1719 | if (rnp == rdp->mynode) { |
@@ -1721,11 +1721,11 @@ rcu_init_percpu_data(int cpu, struct rcu_state *rsp, int preemptable) | |||
1721 | rdp->completed = rnp->completed; | 1721 | rdp->completed = rnp->completed; |
1722 | rdp->passed_quiesc_completed = rnp->completed - 1; | 1722 | rdp->passed_quiesc_completed = rnp->completed - 1; |
1723 | } | 1723 | } |
1724 | spin_unlock(&rnp->lock); /* irqs already disabled. */ | 1724 | raw_spin_unlock(&rnp->lock); /* irqs already disabled. */ |
1725 | rnp = rnp->parent; | 1725 | rnp = rnp->parent; |
1726 | } while (rnp != NULL && !(rnp->qsmaskinit & mask)); | 1726 | } while (rnp != NULL && !(rnp->qsmaskinit & mask)); |
1727 | 1727 | ||
1728 | spin_unlock_irqrestore(&rsp->onofflock, flags); | 1728 | raw_spin_unlock_irqrestore(&rsp->onofflock, flags); |
1729 | } | 1729 | } |
1730 | 1730 | ||
1731 | static void __cpuinit rcu_online_cpu(int cpu) | 1731 | static void __cpuinit rcu_online_cpu(int cpu) |
@@ -1832,7 +1832,7 @@ static void __init rcu_init_one(struct rcu_state *rsp) | |||
1832 | cpustride *= rsp->levelspread[i]; | 1832 | cpustride *= rsp->levelspread[i]; |
1833 | rnp = rsp->level[i]; | 1833 | rnp = rsp->level[i]; |
1834 | for (j = 0; j < rsp->levelcnt[i]; j++, rnp++) { | 1834 | for (j = 0; j < rsp->levelcnt[i]; j++, rnp++) { |
1835 | spin_lock_init(&rnp->lock); | 1835 | raw_spin_lock_init(&rnp->lock); |
1836 | lockdep_set_class_and_name(&rnp->lock, | 1836 | lockdep_set_class_and_name(&rnp->lock, |
1837 | &rcu_node_class[i], buf[i]); | 1837 | &rcu_node_class[i], buf[i]); |
1838 | rnp->gpnum = 0; | 1838 | rnp->gpnum = 0; |
diff --git a/kernel/rcutree.h b/kernel/rcutree.h index 7495fed49c30..6a82c34ce669 100644 --- a/kernel/rcutree.h +++ b/kernel/rcutree.h | |||
@@ -90,7 +90,7 @@ struct rcu_dynticks { | |||
90 | * Definition for node within the RCU grace-period-detection hierarchy. | 90 | * Definition for node within the RCU grace-period-detection hierarchy. |
91 | */ | 91 | */ |
92 | struct rcu_node { | 92 | struct rcu_node { |
93 | spinlock_t lock; /* Root rcu_node's lock protects some */ | 93 | raw_spinlock_t lock; /* Root rcu_node's lock protects some */ |
94 | /* rcu_state fields as well as following. */ | 94 | /* rcu_state fields as well as following. */ |
95 | unsigned long gpnum; /* Current grace period for this node. */ | 95 | unsigned long gpnum; /* Current grace period for this node. */ |
96 | /* This will either be equal to or one */ | 96 | /* This will either be equal to or one */ |
@@ -291,7 +291,7 @@ struct rcu_state { | |||
291 | 291 | ||
292 | /* End of fields guarded by root rcu_node's lock. */ | 292 | /* End of fields guarded by root rcu_node's lock. */ |
293 | 293 | ||
294 | spinlock_t onofflock; /* exclude on/offline and */ | 294 | raw_spinlock_t onofflock; /* exclude on/offline and */ |
295 | /* starting new GP. Also */ | 295 | /* starting new GP. Also */ |
296 | /* protects the following */ | 296 | /* protects the following */ |
297 | /* orphan_cbs fields. */ | 297 | /* orphan_cbs fields. */ |
@@ -301,7 +301,7 @@ struct rcu_state { | |||
301 | /* going offline. */ | 301 | /* going offline. */ |
302 | struct rcu_head **orphan_cbs_tail; /* And tail pointer. */ | 302 | struct rcu_head **orphan_cbs_tail; /* And tail pointer. */ |
303 | long orphan_qlen; /* Number of orphaned cbs. */ | 303 | long orphan_qlen; /* Number of orphaned cbs. */ |
304 | spinlock_t fqslock; /* Only one task forcing */ | 304 | raw_spinlock_t fqslock; /* Only one task forcing */ |
305 | /* quiescent states. */ | 305 | /* quiescent states. */ |
306 | unsigned long jiffies_force_qs; /* Time at which to invoke */ | 306 | unsigned long jiffies_force_qs; /* Time at which to invoke */ |
307 | /* force_quiescent_state(). */ | 307 | /* force_quiescent_state(). */ |
diff --git a/kernel/rcutree_plugin.h b/kernel/rcutree_plugin.h index a82566696b0b..a8b2e834fd3a 100644 --- a/kernel/rcutree_plugin.h +++ b/kernel/rcutree_plugin.h | |||
@@ -111,7 +111,7 @@ static void rcu_preempt_note_context_switch(int cpu) | |||
111 | /* Possibly blocking in an RCU read-side critical section. */ | 111 | /* Possibly blocking in an RCU read-side critical section. */ |
112 | rdp = rcu_preempt_state.rda[cpu]; | 112 | rdp = rcu_preempt_state.rda[cpu]; |
113 | rnp = rdp->mynode; | 113 | rnp = rdp->mynode; |
114 | spin_lock_irqsave(&rnp->lock, flags); | 114 | raw_spin_lock_irqsave(&rnp->lock, flags); |
115 | t->rcu_read_unlock_special |= RCU_READ_UNLOCK_BLOCKED; | 115 | t->rcu_read_unlock_special |= RCU_READ_UNLOCK_BLOCKED; |
116 | t->rcu_blocked_node = rnp; | 116 | t->rcu_blocked_node = rnp; |
117 | 117 | ||
@@ -132,7 +132,7 @@ static void rcu_preempt_note_context_switch(int cpu) | |||
132 | WARN_ON_ONCE(!list_empty(&t->rcu_node_entry)); | 132 | WARN_ON_ONCE(!list_empty(&t->rcu_node_entry)); |
133 | phase = (rnp->gpnum + !(rnp->qsmask & rdp->grpmask)) & 0x1; | 133 | phase = (rnp->gpnum + !(rnp->qsmask & rdp->grpmask)) & 0x1; |
134 | list_add(&t->rcu_node_entry, &rnp->blocked_tasks[phase]); | 134 | list_add(&t->rcu_node_entry, &rnp->blocked_tasks[phase]); |
135 | spin_unlock_irqrestore(&rnp->lock, flags); | 135 | raw_spin_unlock_irqrestore(&rnp->lock, flags); |
136 | } | 136 | } |
137 | 137 | ||
138 | /* | 138 | /* |
@@ -189,7 +189,7 @@ static void rcu_report_unblock_qs_rnp(struct rcu_node *rnp, unsigned long flags) | |||
189 | struct rcu_node *rnp_p; | 189 | struct rcu_node *rnp_p; |
190 | 190 | ||
191 | if (rnp->qsmask != 0 || rcu_preempted_readers(rnp)) { | 191 | if (rnp->qsmask != 0 || rcu_preempted_readers(rnp)) { |
192 | spin_unlock_irqrestore(&rnp->lock, flags); | 192 | raw_spin_unlock_irqrestore(&rnp->lock, flags); |
193 | return; /* Still need more quiescent states! */ | 193 | return; /* Still need more quiescent states! */ |
194 | } | 194 | } |
195 | 195 | ||
@@ -206,8 +206,8 @@ static void rcu_report_unblock_qs_rnp(struct rcu_node *rnp, unsigned long flags) | |||
206 | 206 | ||
207 | /* Report up the rest of the hierarchy. */ | 207 | /* Report up the rest of the hierarchy. */ |
208 | mask = rnp->grpmask; | 208 | mask = rnp->grpmask; |
209 | spin_unlock(&rnp->lock); /* irqs remain disabled. */ | 209 | raw_spin_unlock(&rnp->lock); /* irqs remain disabled. */ |
210 | spin_lock(&rnp_p->lock); /* irqs already disabled. */ | 210 | raw_spin_lock(&rnp_p->lock); /* irqs already disabled. */ |
211 | rcu_report_qs_rnp(mask, &rcu_preempt_state, rnp_p, flags); | 211 | rcu_report_qs_rnp(mask, &rcu_preempt_state, rnp_p, flags); |
212 | } | 212 | } |
213 | 213 | ||
@@ -257,10 +257,10 @@ static void rcu_read_unlock_special(struct task_struct *t) | |||
257 | */ | 257 | */ |
258 | for (;;) { | 258 | for (;;) { |
259 | rnp = t->rcu_blocked_node; | 259 | rnp = t->rcu_blocked_node; |
260 | spin_lock(&rnp->lock); /* irqs already disabled. */ | 260 | raw_spin_lock(&rnp->lock); /* irqs already disabled. */ |
261 | if (rnp == t->rcu_blocked_node) | 261 | if (rnp == t->rcu_blocked_node) |
262 | break; | 262 | break; |
263 | spin_unlock(&rnp->lock); /* irqs remain disabled. */ | 263 | raw_spin_unlock(&rnp->lock); /* irqs remain disabled. */ |
264 | } | 264 | } |
265 | empty = !rcu_preempted_readers(rnp); | 265 | empty = !rcu_preempted_readers(rnp); |
266 | empty_exp = !rcu_preempted_readers_exp(rnp); | 266 | empty_exp = !rcu_preempted_readers_exp(rnp); |
@@ -274,7 +274,7 @@ static void rcu_read_unlock_special(struct task_struct *t) | |||
274 | * Note that rcu_report_unblock_qs_rnp() releases rnp->lock. | 274 | * Note that rcu_report_unblock_qs_rnp() releases rnp->lock. |
275 | */ | 275 | */ |
276 | if (empty) | 276 | if (empty) |
277 | spin_unlock_irqrestore(&rnp->lock, flags); | 277 | raw_spin_unlock_irqrestore(&rnp->lock, flags); |
278 | else | 278 | else |
279 | rcu_report_unblock_qs_rnp(rnp, flags); | 279 | rcu_report_unblock_qs_rnp(rnp, flags); |
280 | 280 | ||
@@ -324,12 +324,12 @@ static void rcu_print_task_stall(struct rcu_node *rnp) | |||
324 | struct task_struct *t; | 324 | struct task_struct *t; |
325 | 325 | ||
326 | if (rcu_preempted_readers(rnp)) { | 326 | if (rcu_preempted_readers(rnp)) { |
327 | spin_lock_irqsave(&rnp->lock, flags); | 327 | raw_spin_lock_irqsave(&rnp->lock, flags); |
328 | phase = rnp->gpnum & 0x1; | 328 | phase = rnp->gpnum & 0x1; |
329 | lp = &rnp->blocked_tasks[phase]; | 329 | lp = &rnp->blocked_tasks[phase]; |
330 | list_for_each_entry(t, lp, rcu_node_entry) | 330 | list_for_each_entry(t, lp, rcu_node_entry) |
331 | printk(" P%d", t->pid); | 331 | printk(" P%d", t->pid); |
332 | spin_unlock_irqrestore(&rnp->lock, flags); | 332 | raw_spin_unlock_irqrestore(&rnp->lock, flags); |
333 | } | 333 | } |
334 | } | 334 | } |
335 | 335 | ||
@@ -400,11 +400,11 @@ static int rcu_preempt_offline_tasks(struct rcu_state *rsp, | |||
400 | lp_root = &rnp_root->blocked_tasks[i]; | 400 | lp_root = &rnp_root->blocked_tasks[i]; |
401 | while (!list_empty(lp)) { | 401 | while (!list_empty(lp)) { |
402 | tp = list_entry(lp->next, typeof(*tp), rcu_node_entry); | 402 | tp = list_entry(lp->next, typeof(*tp), rcu_node_entry); |
403 | spin_lock(&rnp_root->lock); /* irqs already disabled */ | 403 | raw_spin_lock(&rnp_root->lock); /* irqs already disabled */ |
404 | list_del(&tp->rcu_node_entry); | 404 | list_del(&tp->rcu_node_entry); |
405 | tp->rcu_blocked_node = rnp_root; | 405 | tp->rcu_blocked_node = rnp_root; |
406 | list_add(&tp->rcu_node_entry, lp_root); | 406 | list_add(&tp->rcu_node_entry, lp_root); |
407 | spin_unlock(&rnp_root->lock); /* irqs remain disabled */ | 407 | raw_spin_unlock(&rnp_root->lock); /* irqs remain disabled */ |
408 | } | 408 | } |
409 | } | 409 | } |
410 | return retval; | 410 | return retval; |
@@ -528,7 +528,7 @@ static void rcu_report_exp_rnp(struct rcu_state *rsp, struct rcu_node *rnp) | |||
528 | unsigned long flags; | 528 | unsigned long flags; |
529 | unsigned long mask; | 529 | unsigned long mask; |
530 | 530 | ||
531 | spin_lock_irqsave(&rnp->lock, flags); | 531 | raw_spin_lock_irqsave(&rnp->lock, flags); |
532 | for (;;) { | 532 | for (;;) { |
533 | if (!sync_rcu_preempt_exp_done(rnp)) | 533 | if (!sync_rcu_preempt_exp_done(rnp)) |
534 | break; | 534 | break; |
@@ -537,12 +537,12 @@ static void rcu_report_exp_rnp(struct rcu_state *rsp, struct rcu_node *rnp) | |||
537 | break; | 537 | break; |
538 | } | 538 | } |
539 | mask = rnp->grpmask; | 539 | mask = rnp->grpmask; |
540 | spin_unlock(&rnp->lock); /* irqs remain disabled */ | 540 | raw_spin_unlock(&rnp->lock); /* irqs remain disabled */ |
541 | rnp = rnp->parent; | 541 | rnp = rnp->parent; |
542 | spin_lock(&rnp->lock); /* irqs already disabled */ | 542 | raw_spin_lock(&rnp->lock); /* irqs already disabled */ |
543 | rnp->expmask &= ~mask; | 543 | rnp->expmask &= ~mask; |
544 | } | 544 | } |
545 | spin_unlock_irqrestore(&rnp->lock, flags); | 545 | raw_spin_unlock_irqrestore(&rnp->lock, flags); |
546 | } | 546 | } |
547 | 547 | ||
548 | /* | 548 | /* |
@@ -557,11 +557,11 @@ sync_rcu_preempt_exp_init(struct rcu_state *rsp, struct rcu_node *rnp) | |||
557 | { | 557 | { |
558 | int must_wait; | 558 | int must_wait; |
559 | 559 | ||
560 | spin_lock(&rnp->lock); /* irqs already disabled */ | 560 | raw_spin_lock(&rnp->lock); /* irqs already disabled */ |
561 | list_splice_init(&rnp->blocked_tasks[0], &rnp->blocked_tasks[2]); | 561 | list_splice_init(&rnp->blocked_tasks[0], &rnp->blocked_tasks[2]); |
562 | list_splice_init(&rnp->blocked_tasks[1], &rnp->blocked_tasks[3]); | 562 | list_splice_init(&rnp->blocked_tasks[1], &rnp->blocked_tasks[3]); |
563 | must_wait = rcu_preempted_readers_exp(rnp); | 563 | must_wait = rcu_preempted_readers_exp(rnp); |
564 | spin_unlock(&rnp->lock); /* irqs remain disabled */ | 564 | raw_spin_unlock(&rnp->lock); /* irqs remain disabled */ |
565 | if (!must_wait) | 565 | if (!must_wait) |
566 | rcu_report_exp_rnp(rsp, rnp); | 566 | rcu_report_exp_rnp(rsp, rnp); |
567 | } | 567 | } |
@@ -606,13 +606,13 @@ void synchronize_rcu_expedited(void) | |||
606 | /* force all RCU readers onto blocked_tasks[]. */ | 606 | /* force all RCU readers onto blocked_tasks[]. */ |
607 | synchronize_sched_expedited(); | 607 | synchronize_sched_expedited(); |
608 | 608 | ||
609 | spin_lock_irqsave(&rsp->onofflock, flags); | 609 | raw_spin_lock_irqsave(&rsp->onofflock, flags); |
610 | 610 | ||
611 | /* Initialize ->expmask for all non-leaf rcu_node structures. */ | 611 | /* Initialize ->expmask for all non-leaf rcu_node structures. */ |
612 | rcu_for_each_nonleaf_node_breadth_first(rsp, rnp) { | 612 | rcu_for_each_nonleaf_node_breadth_first(rsp, rnp) { |
613 | spin_lock(&rnp->lock); /* irqs already disabled. */ | 613 | raw_spin_lock(&rnp->lock); /* irqs already disabled. */ |
614 | rnp->expmask = rnp->qsmaskinit; | 614 | rnp->expmask = rnp->qsmaskinit; |
615 | spin_unlock(&rnp->lock); /* irqs remain disabled. */ | 615 | raw_spin_unlock(&rnp->lock); /* irqs remain disabled. */ |
616 | } | 616 | } |
617 | 617 | ||
618 | /* Snapshot current state of ->blocked_tasks[] lists. */ | 618 | /* Snapshot current state of ->blocked_tasks[] lists. */ |
@@ -621,7 +621,7 @@ void synchronize_rcu_expedited(void) | |||
621 | if (NUM_RCU_NODES > 1) | 621 | if (NUM_RCU_NODES > 1) |
622 | sync_rcu_preempt_exp_init(rsp, rcu_get_root(rsp)); | 622 | sync_rcu_preempt_exp_init(rsp, rcu_get_root(rsp)); |
623 | 623 | ||
624 | spin_unlock_irqrestore(&rsp->onofflock, flags); | 624 | raw_spin_unlock_irqrestore(&rsp->onofflock, flags); |
625 | 625 | ||
626 | /* Wait for snapshotted ->blocked_tasks[] lists to drain. */ | 626 | /* Wait for snapshotted ->blocked_tasks[] lists to drain. */ |
627 | rnp = rcu_get_root(rsp); | 627 | rnp = rcu_get_root(rsp); |
@@ -756,7 +756,7 @@ static int rcu_preempted_readers(struct rcu_node *rnp) | |||
756 | /* Because preemptible RCU does not exist, no quieting of tasks. */ | 756 | /* Because preemptible RCU does not exist, no quieting of tasks. */ |
757 | static void rcu_report_unblock_qs_rnp(struct rcu_node *rnp, unsigned long flags) | 757 | static void rcu_report_unblock_qs_rnp(struct rcu_node *rnp, unsigned long flags) |
758 | { | 758 | { |
759 | spin_unlock_irqrestore(&rnp->lock, flags); | 759 | raw_spin_unlock_irqrestore(&rnp->lock, flags); |
760 | } | 760 | } |
761 | 761 | ||
762 | #endif /* #ifdef CONFIG_HOTPLUG_CPU */ | 762 | #endif /* #ifdef CONFIG_HOTPLUG_CPU */ |