Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 272215
b: refs/heads/master
c: 4e101b0
h: refs/heads/master
i:
  272213: 9d51675
  272211: 946bd9c
  272207: 4836d58
v: v3
  • Loading branch information
Akinobu Mita authored and Linus Torvalds committed Nov 1, 2011
1 parent a9e76f0 commit d9dbece
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1dff46d6987484eaa31f2fb1425216ba06418be3
refs/heads/master: 4e101b0e6aa885f5786a058eefc1ce4b7cc7c44e
19 changes: 10 additions & 9 deletions trunk/lib/spinlock_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,10 @@ void __rwlock_init(rwlock_t *lock, const char *name,

EXPORT_SYMBOL(__rwlock_init);

static void spin_bug(raw_spinlock_t *lock, const char *msg)
static void spin_dump(raw_spinlock_t *lock, const char *msg)
{
struct task_struct *owner = NULL;

if (!debug_locks_off())
return;

if (lock->owner && lock->owner != SPINLOCK_OWNER_INIT)
owner = lock->owner;
printk(KERN_EMERG "BUG: spinlock %s on CPU#%d, %s/%d\n",
Expand All @@ -70,6 +67,14 @@ static void spin_bug(raw_spinlock_t *lock, const char *msg)
dump_stack();
}

static void spin_bug(raw_spinlock_t *lock, const char *msg)
{
if (!debug_locks_off())
return;

spin_dump(lock, msg);
}

#define SPIN_BUG_ON(cond, lock, msg) if (unlikely(cond)) spin_bug(lock, msg)

static inline void
Expand Down Expand Up @@ -113,11 +118,7 @@ static void __spin_lock_debug(raw_spinlock_t *lock)
/* lockup suspected: */
if (print_once) {
print_once = 0;
printk(KERN_EMERG "BUG: spinlock lockup on CPU#%d, "
"%s/%d, %p\n",
raw_smp_processor_id(), current->comm,
task_pid_nr(current), lock);
dump_stack();
spin_dump(lock, "lockup");
#ifdef CONFIG_SMP
trigger_all_cpu_backtrace();
#endif
Expand Down

0 comments on commit d9dbece

Please sign in to comment.