Skip to content

Commit

Permalink
lockdep/waitqueues: Add better annotation
Browse files Browse the repository at this point in the history
 -> #2 (&tty->write_wait){-.-...}:

is a lot more informative than:

 -> #2 (key#19){-.....}:

Signed-off-by: Peter Zijlstra <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: Linus Torvalds <[email protected]>
Link: http://lkml.kernel.org/n/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
  • Loading branch information
Peter Zijlstra authored and Ingo Molnar committed Dec 21, 2011
1 parent 2d2b774 commit f07fdec
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions include/linux/wait.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,13 @@ struct task_struct;
#define __WAIT_BIT_KEY_INITIALIZER(word, bit) \
{ .flags = word, .bit_nr = bit, }

extern void __init_waitqueue_head(wait_queue_head_t *q, struct lock_class_key *);
extern void __init_waitqueue_head(wait_queue_head_t *q, const char *name, struct lock_class_key *);

#define init_waitqueue_head(q) \
do { \
static struct lock_class_key __key; \
\
__init_waitqueue_head((q), &__key); \
__init_waitqueue_head((q), #q, &__key); \
} while (0)

#ifdef CONFIG_LOCKDEP
Expand Down
4 changes: 2 additions & 2 deletions kernel/wait.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
#include <linux/wait.h>
#include <linux/hash.h>

void __init_waitqueue_head(wait_queue_head_t *q, struct lock_class_key *key)
void __init_waitqueue_head(wait_queue_head_t *q, const char *name, struct lock_class_key *key)
{
spin_lock_init(&q->lock);
lockdep_set_class(&q->lock, key);
lockdep_set_class_and_name(&q->lock, key, name);
INIT_LIST_HEAD(&q->task_list);
}

Expand Down

0 comments on commit f07fdec

Please sign in to comment.