diff options
Diffstat (limited to 'kernel/rcuclassic.c')
-rw-r--r-- | kernel/rcuclassic.c | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/kernel/rcuclassic.c b/kernel/rcuclassic.c index bd5a9003497c..0f2b0b311304 100644 --- a/kernel/rcuclassic.c +++ b/kernel/rcuclassic.c | |||
@@ -65,6 +65,7 @@ static struct rcu_ctrlblk rcu_ctrlblk = { | |||
65 | .lock = __SPIN_LOCK_UNLOCKED(&rcu_ctrlblk.lock), | 65 | .lock = __SPIN_LOCK_UNLOCKED(&rcu_ctrlblk.lock), |
66 | .cpumask = CPU_BITS_NONE, | 66 | .cpumask = CPU_BITS_NONE, |
67 | }; | 67 | }; |
68 | |||
68 | static struct rcu_ctrlblk rcu_bh_ctrlblk = { | 69 | static struct rcu_ctrlblk rcu_bh_ctrlblk = { |
69 | .cur = -300, | 70 | .cur = -300, |
70 | .completed = -300, | 71 | .completed = -300, |
@@ -73,8 +74,26 @@ static struct rcu_ctrlblk rcu_bh_ctrlblk = { | |||
73 | .cpumask = CPU_BITS_NONE, | 74 | .cpumask = CPU_BITS_NONE, |
74 | }; | 75 | }; |
75 | 76 | ||
76 | DEFINE_PER_CPU(struct rcu_data, rcu_data) = { 0L }; | 77 | static DEFINE_PER_CPU(struct rcu_data, rcu_data); |
77 | DEFINE_PER_CPU(struct rcu_data, rcu_bh_data) = { 0L }; | 78 | static DEFINE_PER_CPU(struct rcu_data, rcu_bh_data); |
79 | |||
80 | /* | ||
81 | * Increment the quiescent state counter. | ||
82 | * The counter is a bit degenerated: We do not need to know | ||
83 | * how many quiescent states passed, just if there was at least | ||
84 | * one since the start of the grace period. Thus just a flag. | ||
85 | */ | ||
86 | void rcu_qsctr_inc(int cpu) | ||
87 | { | ||
88 | struct rcu_data *rdp = &per_cpu(rcu_data, cpu); | ||
89 | rdp->passed_quiesc = 1; | ||
90 | } | ||
91 | |||
92 | void rcu_bh_qsctr_inc(int cpu) | ||
93 | { | ||
94 | struct rcu_data *rdp = &per_cpu(rcu_bh_data, cpu); | ||
95 | rdp->passed_quiesc = 1; | ||
96 | } | ||
78 | 97 | ||
79 | static int blimit = 10; | 98 | static int blimit = 10; |
80 | static int qhimark = 10000; | 99 | static int qhimark = 10000; |
@@ -679,8 +698,8 @@ int rcu_needs_cpu(int cpu) | |||
679 | void rcu_check_callbacks(int cpu, int user) | 698 | void rcu_check_callbacks(int cpu, int user) |
680 | { | 699 | { |
681 | if (user || | 700 | if (user || |
682 | (idle_cpu(cpu) && !in_softirq() && | 701 | (idle_cpu(cpu) && rcu_scheduler_active && |
683 | hardirq_count() <= (1 << HARDIRQ_SHIFT))) { | 702 | !in_softirq() && hardirq_count() <= (1 << HARDIRQ_SHIFT))) { |
684 | 703 | ||
685 | /* | 704 | /* |
686 | * Get here if this CPU took its interrupt from user | 705 | * Get here if this CPU took its interrupt from user |