aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-09-04 11:17:12 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-09-04 11:17:12 -0400
commitb854e4de0bf88d094476af82c0d5a80f6f2af916 (patch)
tree6e9b0a9f28468b043bd395fd816c4b44d4ac8f58 /lib
parent458c3f60ef12996d5a5b390260a5112bb1da1615 (diff)
parent7d992feb7694a21ee81f22894b455dadd5d1c110 (diff)
Merge branch 'core-rcu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull RCU updates from Ingo Molnar: "Main RCU changes this cycle were: - Full-system idle detection. This is for use by Frederic Weisbecker's adaptive-ticks mechanism. Its purpose is to allow the timekeeping CPU to shut off its tick when all other CPUs are idle. - Miscellaneous fixes. - Improved rcutorture test coverage. - Updated RCU documentation" * 'core-rcu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (30 commits) nohz_full: Force RCU's grace-period kthreads onto timekeeping CPU nohz_full: Add full-system-idle state machine jiffies: Avoid undefined behavior from signed overflow rcu: Simplify _rcu_barrier() processing rcu: Make rcutorture emit online failures if verbose rcu: Remove unused variable from rcu_torture_writer() rcu: Sort rcutorture module parameters rcu: Increase rcutorture test coverage rcu: Add duplicate-callback tests to rcutorture doc: Fix memory-barrier control-dependency example rcu: Update RTFP documentation nohz_full: Add full-system-idle arguments to API nohz_full: Add full-system idle states and variables nohz_full: Add per-CPU idle-state tracking nohz_full: Add rcu_dyntick data for scalable detection of all-idle state nohz_full: Add Kconfig parameter for scalable detection of all-idle state nohz_full: Add testing information to documentation rcu: Eliminate unused APIs intended for adaptive ticks rcu: Select IRQ_WORK from TREE_PREEMPT_RCU rculist: list_first_or_null_rcu() should use list_entry_rcu() ...
Diffstat (limited to 'lib')
-rw-r--r--lib/debugobjects.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/lib/debugobjects.c b/lib/debugobjects.c
index 37061ede8b81..bf2c8b1043d8 100644
--- a/lib/debugobjects.c
+++ b/lib/debugobjects.c
@@ -381,19 +381,21 @@ void debug_object_init_on_stack(void *addr, struct debug_obj_descr *descr)
381 * debug_object_activate - debug checks when an object is activated 381 * debug_object_activate - debug checks when an object is activated
382 * @addr: address of the object 382 * @addr: address of the object
383 * @descr: pointer to an object specific debug description structure 383 * @descr: pointer to an object specific debug description structure
384 * Returns 0 for success, -EINVAL for check failed.
384 */ 385 */
385void debug_object_activate(void *addr, struct debug_obj_descr *descr) 386int debug_object_activate(void *addr, struct debug_obj_descr *descr)
386{ 387{
387 enum debug_obj_state state; 388 enum debug_obj_state state;
388 struct debug_bucket *db; 389 struct debug_bucket *db;
389 struct debug_obj *obj; 390 struct debug_obj *obj;
390 unsigned long flags; 391 unsigned long flags;
392 int ret;
391 struct debug_obj o = { .object = addr, 393 struct debug_obj o = { .object = addr,
392 .state = ODEBUG_STATE_NOTAVAILABLE, 394 .state = ODEBUG_STATE_NOTAVAILABLE,
393 .descr = descr }; 395 .descr = descr };
394 396
395 if (!debug_objects_enabled) 397 if (!debug_objects_enabled)
396 return; 398 return 0;
397 399
398 db = get_bucket((unsigned long) addr); 400 db = get_bucket((unsigned long) addr);
399 401
@@ -405,23 +407,26 @@ void debug_object_activate(void *addr, struct debug_obj_descr *descr)
405 case ODEBUG_STATE_INIT: 407 case ODEBUG_STATE_INIT:
406 case ODEBUG_STATE_INACTIVE: 408 case ODEBUG_STATE_INACTIVE:
407 obj->state = ODEBUG_STATE_ACTIVE; 409 obj->state = ODEBUG_STATE_ACTIVE;
410 ret = 0;
408 break; 411 break;
409 412
410 case ODEBUG_STATE_ACTIVE: 413 case ODEBUG_STATE_ACTIVE:
411 debug_print_object(obj, "activate"); 414 debug_print_object(obj, "activate");
412 state = obj->state; 415 state = obj->state;
413 raw_spin_unlock_irqrestore(&db->lock, flags); 416 raw_spin_unlock_irqrestore(&db->lock, flags);
414 debug_object_fixup(descr->fixup_activate, addr, state); 417 ret = debug_object_fixup(descr->fixup_activate, addr, state);
415 return; 418 return ret ? -EINVAL : 0;
416 419
417 case ODEBUG_STATE_DESTROYED: 420 case ODEBUG_STATE_DESTROYED:
418 debug_print_object(obj, "activate"); 421 debug_print_object(obj, "activate");
422 ret = -EINVAL;
419 break; 423 break;
420 default: 424 default:
425 ret = 0;
421 break; 426 break;
422 } 427 }
423 raw_spin_unlock_irqrestore(&db->lock, flags); 428 raw_spin_unlock_irqrestore(&db->lock, flags);
424 return; 429 return ret;
425 } 430 }
426 431
427 raw_spin_unlock_irqrestore(&db->lock, flags); 432 raw_spin_unlock_irqrestore(&db->lock, flags);
@@ -431,8 +436,11 @@ void debug_object_activate(void *addr, struct debug_obj_descr *descr)
431 * true or not. 436 * true or not.
432 */ 437 */
433 if (debug_object_fixup(descr->fixup_activate, addr, 438 if (debug_object_fixup(descr->fixup_activate, addr,
434 ODEBUG_STATE_NOTAVAILABLE)) 439 ODEBUG_STATE_NOTAVAILABLE)) {
435 debug_print_object(&o, "activate"); 440 debug_print_object(&o, "activate");
441 return -EINVAL;
442 }
443 return 0;
436} 444}
437 445
438/** 446/**