Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 42838
b: refs/heads/master
c: d5abe66
h: refs/heads/master
v: v3
  • Loading branch information
Peter Zijlstra authored and Linus Torvalds committed Dec 7, 2006
1 parent 1188e89 commit 29d3b1d
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6fb50ea79cb869667adaa71ed32cc15dd73986de
refs/heads/master: d5abe669172f20a4129a711de0f250a4e07db298
5 changes: 5 additions & 0 deletions trunk/include/linux/lockdep.h
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,8 @@ extern void lock_release(struct lockdep_map *lock, int nested,

# define INIT_LOCKDEP .lockdep_recursion = 0,

#define lockdep_depth(tsk) ((tsk)->lockdep_depth)

#else /* !LOCKDEP */

static inline void lockdep_off(void)
Expand Down Expand Up @@ -277,6 +279,9 @@ static inline int lockdep_internal(void)
* The class key takes no space if lockdep is disabled:
*/
struct lock_class_key { };

#define lockdep_depth(tsk) (0)

#endif /* !LOCKDEP */

#if defined(CONFIG_TRACE_IRQFLAGS) && defined(CONFIG_GENERIC_HARDIRQS)
Expand Down
13 changes: 13 additions & 0 deletions trunk/kernel/workqueue.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
#include <linux/hardirq.h>
#include <linux/mempolicy.h>
#include <linux/freezer.h>
#include <linux/kallsyms.h>
#include <linux/debug_locks.h>

/*
* The per-CPU workqueue (if single thread, we always use the first
Expand Down Expand Up @@ -253,6 +255,17 @@ static void run_workqueue(struct cpu_workqueue_struct *cwq)
work_release(work);
f(work);

if (unlikely(in_atomic() || lockdep_depth(current) > 0)) {
printk(KERN_ERR "BUG: workqueue leaked lock or atomic: "
"%s/0x%08x/%d\n",
current->comm, preempt_count(),
current->pid);
printk(KERN_ERR " last function: ");
print_symbol("%s\n", (unsigned long)f);
debug_show_held_locks(current);
dump_stack();
}

spin_lock_irqsave(&cwq->lock, flags);
cwq->remove_sequence++;
wake_up(&cwq->work_done);
Expand Down

0 comments on commit 29d3b1d

Please sign in to comment.