aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/rcutree.c
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>2010-02-22 20:05:02 -0500
committerIngo Molnar <mingo@elte.hu>2010-02-25 04:34:58 -0500
commit1304afb225288a2e250d6a7495462c28e5509cbb (patch)
tree1ba76e304f718f7ce89532e1c4d276b4af439c07 /kernel/rcutree.c
parent20133cfce7d0bbdcc0c398301030c091f5675c88 (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>
Diffstat (limited to 'kernel/rcutree.c')
-rw-r--r--kernel/rcutree.c132
1 files changed, 66 insertions, 66 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 */
1268unlock_fqs_ret: 1268unlock_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
1731static void __cpuinit rcu_online_cpu(int cpu) 1731static 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;