diff options
Diffstat (limited to 'kernel/mutex-debug.c')
| -rw-r--r-- | kernel/mutex-debug.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/kernel/mutex-debug.c b/kernel/mutex-debug.c index f4913c376950..e38e4bac97ca 100644 --- a/kernel/mutex-debug.c +++ b/kernel/mutex-debug.c | |||
| @@ -16,6 +16,7 @@ | |||
| 16 | #include <linux/sched.h> | 16 | #include <linux/sched.h> |
| 17 | #include <linux/delay.h> | 17 | #include <linux/delay.h> |
| 18 | #include <linux/module.h> | 18 | #include <linux/module.h> |
| 19 | #include <linux/poison.h> | ||
| 19 | #include <linux/spinlock.h> | 20 | #include <linux/spinlock.h> |
| 20 | #include <linux/kallsyms.h> | 21 | #include <linux/kallsyms.h> |
| 21 | #include <linux/interrupt.h> | 22 | #include <linux/interrupt.h> |
| @@ -153,13 +154,13 @@ next: | |||
| 153 | continue; | 154 | continue; |
| 154 | count++; | 155 | count++; |
| 155 | cursor = curr->next; | 156 | cursor = curr->next; |
| 156 | debug_spin_lock_restore(&debug_mutex_lock, flags); | 157 | debug_spin_unlock_restore(&debug_mutex_lock, flags); |
| 157 | 158 | ||
| 158 | printk("\n#%03d: ", count); | 159 | printk("\n#%03d: ", count); |
| 159 | printk_lock(lock, filter ? 0 : 1); | 160 | printk_lock(lock, filter ? 0 : 1); |
| 160 | goto next; | 161 | goto next; |
| 161 | } | 162 | } |
| 162 | debug_spin_lock_restore(&debug_mutex_lock, flags); | 163 | debug_spin_unlock_restore(&debug_mutex_lock, flags); |
| 163 | printk("\n"); | 164 | printk("\n"); |
| 164 | } | 165 | } |
| 165 | 166 | ||
| @@ -316,7 +317,7 @@ void mutex_debug_check_no_locks_held(struct task_struct *task) | |||
| 316 | continue; | 317 | continue; |
| 317 | list_del_init(curr); | 318 | list_del_init(curr); |
| 318 | DEBUG_OFF(); | 319 | DEBUG_OFF(); |
| 319 | debug_spin_lock_restore(&debug_mutex_lock, flags); | 320 | debug_spin_unlock_restore(&debug_mutex_lock, flags); |
| 320 | 321 | ||
| 321 | printk("BUG: %s/%d, lock held at task exit time!\n", | 322 | printk("BUG: %s/%d, lock held at task exit time!\n", |
| 322 | task->comm, task->pid); | 323 | task->comm, task->pid); |
| @@ -325,7 +326,7 @@ void mutex_debug_check_no_locks_held(struct task_struct *task) | |||
| 325 | printk("exiting task is not even the owner??\n"); | 326 | printk("exiting task is not even the owner??\n"); |
| 326 | return; | 327 | return; |
| 327 | } | 328 | } |
| 328 | debug_spin_lock_restore(&debug_mutex_lock, flags); | 329 | debug_spin_unlock_restore(&debug_mutex_lock, flags); |
| 329 | } | 330 | } |
| 330 | 331 | ||
| 331 | /* | 332 | /* |
| @@ -352,7 +353,7 @@ void mutex_debug_check_no_locks_freed(const void *from, unsigned long len) | |||
| 352 | continue; | 353 | continue; |
| 353 | list_del_init(curr); | 354 | list_del_init(curr); |
| 354 | DEBUG_OFF(); | 355 | DEBUG_OFF(); |
| 355 | debug_spin_lock_restore(&debug_mutex_lock, flags); | 356 | debug_spin_unlock_restore(&debug_mutex_lock, flags); |
| 356 | 357 | ||
| 357 | printk("BUG: %s/%d, active lock [%p(%p-%p)] freed!\n", | 358 | printk("BUG: %s/%d, active lock [%p(%p-%p)] freed!\n", |
| 358 | current->comm, current->pid, lock, from, to); | 359 | current->comm, current->pid, lock, from, to); |
| @@ -362,7 +363,7 @@ void mutex_debug_check_no_locks_freed(const void *from, unsigned long len) | |||
| 362 | printk("freeing task is not even the owner??\n"); | 363 | printk("freeing task is not even the owner??\n"); |
| 363 | return; | 364 | return; |
| 364 | } | 365 | } |
| 365 | debug_spin_lock_restore(&debug_mutex_lock, flags); | 366 | debug_spin_unlock_restore(&debug_mutex_lock, flags); |
| 366 | } | 367 | } |
| 367 | 368 | ||
| 368 | /* | 369 | /* |
| @@ -381,7 +382,7 @@ void debug_mutex_set_owner(struct mutex *lock, | |||
| 381 | 382 | ||
| 382 | void debug_mutex_init_waiter(struct mutex_waiter *waiter) | 383 | void debug_mutex_init_waiter(struct mutex_waiter *waiter) |
| 383 | { | 384 | { |
| 384 | memset(waiter, 0x11, sizeof(*waiter)); | 385 | memset(waiter, MUTEX_DEBUG_INIT, sizeof(*waiter)); |
| 385 | waiter->magic = waiter; | 386 | waiter->magic = waiter; |
| 386 | INIT_LIST_HEAD(&waiter->list); | 387 | INIT_LIST_HEAD(&waiter->list); |
| 387 | } | 388 | } |
| @@ -397,7 +398,7 @@ void debug_mutex_wake_waiter(struct mutex *lock, struct mutex_waiter *waiter) | |||
| 397 | void debug_mutex_free_waiter(struct mutex_waiter *waiter) | 398 | void debug_mutex_free_waiter(struct mutex_waiter *waiter) |
| 398 | { | 399 | { |
| 399 | DEBUG_WARN_ON(!list_empty(&waiter->list)); | 400 | DEBUG_WARN_ON(!list_empty(&waiter->list)); |
| 400 | memset(waiter, 0x22, sizeof(*waiter)); | 401 | memset(waiter, MUTEX_DEBUG_FREE, sizeof(*waiter)); |
| 401 | } | 402 | } |
| 402 | 403 | ||
| 403 | void debug_mutex_add_waiter(struct mutex *lock, struct mutex_waiter *waiter, | 404 | void debug_mutex_add_waiter(struct mutex *lock, struct mutex_waiter *waiter, |
