diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2011-05-20 14:06:24 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2011-05-20 14:08:05 -0400 |
commit | 250f972d85effad5b6e10da4bbd877e6a4b503b6 (patch) | |
tree | 007393a6fc6439af7e0121dd99a6f9f9fb8405bc /kernel/rcupdate.c | |
parent | 7372b0b122af0f6675f3ab65bfd91c8a438e0480 (diff) | |
parent | bbe7b8bef48c567f5ff3f6041c1fb011292e8f12 (diff) |
Merge branch 'timers/urgent' into timers/core
Reason: Get upstream fixes and kfree_rcu which is necessary for a
follow up patch.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/rcupdate.c')
-rw-r--r-- | kernel/rcupdate.c | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/kernel/rcupdate.c b/kernel/rcupdate.c index f3240e987928..7784bd216b6a 100644 --- a/kernel/rcupdate.c +++ b/kernel/rcupdate.c | |||
@@ -142,10 +142,17 @@ static int rcuhead_fixup_init(void *addr, enum debug_obj_state state) | |||
142 | * Ensure that queued callbacks are all executed. | 142 | * Ensure that queued callbacks are all executed. |
143 | * 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 |
144 | * 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. | ||
145 | */ | 148 | */ |
149 | #ifndef CONFIG_PREEMPT | ||
150 | WARN_ON_ONCE(1); | ||
151 | return 0; | ||
152 | #endif | ||
146 | if (rcu_preempt_depth() != 0 || preempt_count() != 0 || | 153 | if (rcu_preempt_depth() != 0 || preempt_count() != 0 || |
147 | irqs_disabled()) { | 154 | irqs_disabled()) { |
148 | WARN_ON(1); | 155 | WARN_ON_ONCE(1); |
149 | return 0; | 156 | return 0; |
150 | } | 157 | } |
151 | rcu_barrier(); | 158 | rcu_barrier(); |
@@ -184,10 +191,17 @@ static int rcuhead_fixup_activate(void *addr, enum debug_obj_state state) | |||
184 | * Ensure that queued callbacks are all executed. | 191 | * Ensure that queued callbacks are all executed. |
185 | * 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 |
186 | * 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. | ||
187 | */ | 197 | */ |
198 | #ifndef CONFIG_PREEMPT | ||
199 | WARN_ON_ONCE(1); | ||
200 | return 0; | ||
201 | #endif | ||
188 | if (rcu_preempt_depth() != 0 || preempt_count() != 0 || | 202 | if (rcu_preempt_depth() != 0 || preempt_count() != 0 || |
189 | irqs_disabled()) { | 203 | irqs_disabled()) { |
190 | WARN_ON(1); | 204 | WARN_ON_ONCE(1); |
191 | return 0; | 205 | return 0; |
192 | } | 206 | } |
193 | rcu_barrier(); | 207 | rcu_barrier(); |
@@ -214,15 +228,17 @@ static int rcuhead_fixup_free(void *addr, enum debug_obj_state state) | |||
214 | * Ensure that queued callbacks are all executed. | 228 | * Ensure that queued callbacks are all executed. |
215 | * 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 |
216 | * section, we should simply fail, otherwise we would deadlock. | 230 | * section, we should simply fail, otherwise we would deadlock. |
217 | * Note that the machinery to reliably determine whether | 231 | * In !PREEMPT configurations, there is no way to tell if we are |
218 | * or not we are in an RCU read-side critical section | 232 | * in a RCU read-side critical section or not, so we never |
219 | * exists only in the preemptible RCU implementations | 233 | * attempt any fixup and just print a warning. |
220 | * (TINY_PREEMPT_RCU and TREE_PREEMPT_RCU), which is why | ||
221 | * DEBUG_OBJECTS_RCU_HEAD is disallowed if !PREEMPT. | ||
222 | */ | 234 | */ |
235 | #ifndef CONFIG_PREEMPT | ||
236 | WARN_ON_ONCE(1); | ||
237 | return 0; | ||
238 | #endif | ||
223 | if (rcu_preempt_depth() != 0 || preempt_count() != 0 || | 239 | if (rcu_preempt_depth() != 0 || preempt_count() != 0 || |
224 | irqs_disabled()) { | 240 | irqs_disabled()) { |
225 | WARN_ON(1); | 241 | WARN_ON_ONCE(1); |
226 | return 0; | 242 | return 0; |
227 | } | 243 | } |
228 | rcu_barrier(); | 244 | rcu_barrier(); |