diff options
author | Andrea Bastoni <bastoni@cs.unc.edu> | 2011-08-27 09:43:54 -0400 |
---|---|---|
committer | Andrea Bastoni <bastoni@cs.unc.edu> | 2011-08-27 10:06:11 -0400 |
commit | 7b1bb388bc879ffcc6c69b567816d5c354afe42b (patch) | |
tree | 5a217fdfb0b5e5a327bdcd624506337c1ae1fe32 /kernel/rcupdate.c | |
parent | 7d754596756240fa918b94cd0c3011c77a638987 (diff) | |
parent | 02f8c6aee8df3cdc935e9bdd4f2d020306035dbe (diff) |
Merge 'Linux v3.0' into Litmus
Some notes:
* Litmus^RT scheduling class is the topmost scheduling class
(above stop_sched_class).
* scheduler_ipi() function (e.g., in smp_reschedule_interrupt())
may increase IPI latencies.
* Added path into schedule() to quickly re-evaluate scheduling
decision without becoming preemptive again. This used to be
a standard path before the removal of BKL.
Conflicts:
Makefile
arch/arm/kernel/calls.S
arch/arm/kernel/smp.c
arch/x86/include/asm/unistd_32.h
arch/x86/kernel/smp.c
arch/x86/kernel/syscall_table_32.S
include/linux/hrtimer.h
kernel/printk.c
kernel/sched.c
kernel/sched_fair.c
Diffstat (limited to 'kernel/rcupdate.c')
-rw-r--r-- | kernel/rcupdate.c | 36 |
1 files changed, 27 insertions, 9 deletions
diff --git a/kernel/rcupdate.c b/kernel/rcupdate.c index 4d169835fb36..7784bd216b6a 100644 --- a/kernel/rcupdate.c +++ b/kernel/rcupdate.c | |||
@@ -73,12 +73,14 @@ int debug_lockdep_rcu_enabled(void) | |||
73 | EXPORT_SYMBOL_GPL(debug_lockdep_rcu_enabled); | 73 | EXPORT_SYMBOL_GPL(debug_lockdep_rcu_enabled); |
74 | 74 | ||
75 | /** | 75 | /** |
76 | * rcu_read_lock_bh_held - might we be in RCU-bh read-side critical section? | 76 | * rcu_read_lock_bh_held() - might we be in RCU-bh read-side critical section? |
77 | * | 77 | * |
78 | * Check for bottom half being disabled, which covers both the | 78 | * Check for bottom half being disabled, which covers both the |
79 | * CONFIG_PROVE_RCU and not cases. Note that if someone uses | 79 | * CONFIG_PROVE_RCU and not cases. Note that if someone uses |
80 | * rcu_read_lock_bh(), but then later enables BH, lockdep (if enabled) | 80 | * rcu_read_lock_bh(), but then later enables BH, lockdep (if enabled) |
81 | * will show the situation. | 81 | * will show the situation. This is useful for debug checks in functions |
82 | * that require that they be called within an RCU read-side critical | ||
83 | * section. | ||
82 | * | 84 | * |
83 | * Check debug_lockdep_rcu_enabled() to prevent false positives during boot. | 85 | * Check debug_lockdep_rcu_enabled() to prevent false positives during boot. |
84 | */ | 86 | */ |
@@ -86,7 +88,7 @@ int rcu_read_lock_bh_held(void) | |||
86 | { | 88 | { |
87 | if (!debug_lockdep_rcu_enabled()) | 89 | if (!debug_lockdep_rcu_enabled()) |
88 | return 1; | 90 | return 1; |
89 | return in_softirq(); | 91 | return in_softirq() || irqs_disabled(); |
90 | } | 92 | } |
91 | EXPORT_SYMBOL_GPL(rcu_read_lock_bh_held); | 93 | EXPORT_SYMBOL_GPL(rcu_read_lock_bh_held); |
92 | 94 | ||
@@ -140,10 +142,17 @@ static int rcuhead_fixup_init(void *addr, enum debug_obj_state state) | |||
140 | * Ensure that queued callbacks are all executed. | 142 | * Ensure that queued callbacks are all executed. |
141 | * If we detect that we are nested in a RCU read-side critical | 143 | * If we detect that we are nested in a RCU read-side critical |
142 | * section, we should simply fail, otherwise we would deadlock. | 144 | * section, we should simply fail, otherwise we would deadlock. |
145 | * In !PREEMPT configurations, there is no way to tell if we are | ||
146 | * in a RCU read-side critical section or not, so we never | ||
147 | * attempt any fixup and just print a warning. | ||
143 | */ | 148 | */ |
149 | #ifndef CONFIG_PREEMPT | ||
150 | WARN_ON_ONCE(1); | ||
151 | return 0; | ||
152 | #endif | ||
144 | if (rcu_preempt_depth() != 0 || preempt_count() != 0 || | 153 | if (rcu_preempt_depth() != 0 || preempt_count() != 0 || |
145 | irqs_disabled()) { | 154 | irqs_disabled()) { |
146 | WARN_ON(1); | 155 | WARN_ON_ONCE(1); |
147 | return 0; | 156 | return 0; |
148 | } | 157 | } |
149 | rcu_barrier(); | 158 | rcu_barrier(); |
@@ -182,10 +191,17 @@ static int rcuhead_fixup_activate(void *addr, enum debug_obj_state state) | |||
182 | * Ensure that queued callbacks are all executed. | 191 | * Ensure that queued callbacks are all executed. |
183 | * If we detect that we are nested in a RCU read-side critical | 192 | * If we detect that we are nested in a RCU read-side critical |
184 | * section, we should simply fail, otherwise we would deadlock. | 193 | * section, we should simply fail, otherwise we would deadlock. |
194 | * In !PREEMPT configurations, there is no way to tell if we are | ||
195 | * in a RCU read-side critical section or not, so we never | ||
196 | * attempt any fixup and just print a warning. | ||
185 | */ | 197 | */ |
198 | #ifndef CONFIG_PREEMPT | ||
199 | WARN_ON_ONCE(1); | ||
200 | return 0; | ||
201 | #endif | ||
186 | if (rcu_preempt_depth() != 0 || preempt_count() != 0 || | 202 | if (rcu_preempt_depth() != 0 || preempt_count() != 0 || |
187 | irqs_disabled()) { | 203 | irqs_disabled()) { |
188 | WARN_ON(1); | 204 | WARN_ON_ONCE(1); |
189 | return 0; | 205 | return 0; |
190 | } | 206 | } |
191 | rcu_barrier(); | 207 | rcu_barrier(); |
@@ -212,14 +228,17 @@ static int rcuhead_fixup_free(void *addr, enum debug_obj_state state) | |||
212 | * Ensure that queued callbacks are all executed. | 228 | * Ensure that queued callbacks are all executed. |
213 | * If we detect that we are nested in a RCU read-side critical | 229 | * If we detect that we are nested in a RCU read-side critical |
214 | * section, we should simply fail, otherwise we would deadlock. | 230 | * section, we should simply fail, otherwise we would deadlock. |
231 | * In !PREEMPT configurations, there is no way to tell if we are | ||
232 | * in a RCU read-side critical section or not, so we never | ||
233 | * attempt any fixup and just print a warning. | ||
215 | */ | 234 | */ |
216 | #ifndef CONFIG_PREEMPT | 235 | #ifndef CONFIG_PREEMPT |
217 | WARN_ON(1); | 236 | WARN_ON_ONCE(1); |
218 | return 0; | 237 | return 0; |
219 | #else | 238 | #endif |
220 | if (rcu_preempt_depth() != 0 || preempt_count() != 0 || | 239 | if (rcu_preempt_depth() != 0 || preempt_count() != 0 || |
221 | irqs_disabled()) { | 240 | irqs_disabled()) { |
222 | WARN_ON(1); | 241 | WARN_ON_ONCE(1); |
223 | return 0; | 242 | return 0; |
224 | } | 243 | } |
225 | rcu_barrier(); | 244 | rcu_barrier(); |
@@ -227,7 +246,6 @@ static int rcuhead_fixup_free(void *addr, enum debug_obj_state state) | |||
227 | rcu_barrier_bh(); | 246 | rcu_barrier_bh(); |
228 | debug_object_free(head, &rcuhead_debug_descr); | 247 | debug_object_free(head, &rcuhead_debug_descr); |
229 | return 1; | 248 | return 1; |
230 | #endif | ||
231 | default: | 249 | default: |
232 | return 0; | 250 | return 0; |
233 | } | 251 | } |