Changeset 5b03a72 in mainline for kernel/generic/src
- Timestamp:
- 2012-07-29T17:53:48Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f0fcb04
- Parents:
- 8e3ed06
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/synch/rcu.c
r8e3ed06 r5b03a72 225 225 CPU->rcu.last_seen_gp = 0; 226 226 227 CPU->rcu.pnesting_cnt = &CPU->rcu.tmp_nesting_cnt; 228 CPU->rcu.tmp_nesting_cnt = 0; 227 CPU->rcu.nesting_cnt = 0; 229 228 230 229 CPU->rcu.cur_cbs = 0; … … 286 285 * reader section nesting count while we examine/process it. 287 286 */ 288 ASSERT(&CPU->rcu.tmp_nesting_cnt == CPU->rcu.pnesting_cnt); 289 290 /* 291 * The thread forgot to exit its reader critical secion. 287 288 /* 289 * The thread forgot to exit its reader critical section. 292 290 * It is a bug, but rather than letting the entire system lock up 293 291 * forcefully leave the reader section. The thread is not holding … … 373 371 { 374 372 preemption_disable(); 375 bool locked = 0 < *CPU->rcu.pnesting_cnt;373 bool locked = 0 < CPU->rcu.nesting_cnt; 376 374 preemption_enable(); 377 375 … … 483 481 { 484 482 /* Calling from a reader section will deadlock. */ 485 ASSERT( THREAD == 0 || 0 == THREAD->rcu.nesting_cnt);483 ASSERT(0 == CPU->rcu.nesting_cnt); 486 484 487 485 synch_item_t completion; … … 1199 1197 if (CPU->rcu.last_seen_gp != _rcu_cur_gp) { 1200 1198 /* Interrupted a reader in a reader critical section. */ 1201 if (0 < (*CPU->rcu.pnesting_cnt)) {1199 if (0 < CPU->rcu.nesting_cnt) { 1202 1200 ASSERT(!CPU->idle); 1203 1201 /* Note to notify the detector from rcu_read_unlock(). */ … … 1276 1274 { 1277 1275 ASSERT(interrupts_disabled()); 1278 ASSERT(CPU->rcu.pnesting_cnt == &THREAD->rcu.nesting_cnt); 1276 1277 /* Save the thread's nesting count when its not running. */ 1278 THREAD->rcu.nesting_cnt = CPU->rcu.nesting_cnt; 1279 /* Interrupt handlers might use RCU while idle in scheduler(). */ 1280 CPU->rcu.nesting_cnt = 0; 1279 1281 1280 1282 /* Preempted a reader critical section for the first time. */ … … 1317 1319 1318 1320 /* 1319 * After this point THREAD is 0 and stays 0 until the scheduler()1320 * switches to a new thread. Use a temporary nesting counter for readers1321 * in handlers of interrupts that are raised while idle in the scheduler.1322 */1323 CPU->rcu.pnesting_cnt = &CPU->rcu.tmp_nesting_cnt;1324 1325 /*1326 1321 * Forcefully associate the detector with the highest priority 1327 1322 * even if preempted due to its time slice running out. … … 1355 1350 { 1356 1351 ASSERT(PREEMPTION_DISABLED || interrupts_disabled()); 1357 ASSERT(&CPU->rcu.tmp_nesting_cnt == CPU->rcu.pnesting_cnt); 1358 1359 CPU->rcu.pnesting_cnt = &THREAD->rcu.nesting_cnt; 1352 ASSERT(0 == CPU->rcu.nesting_cnt); 1353 1354 /* Load the thread's saved nesting count from before it was preempted. */ 1355 CPU->rcu.nesting_cnt = THREAD->rcu.nesting_cnt; 1360 1356 } 1361 1357
Note:
See TracChangeset
for help on using the changeset viewer.