Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

lockdep/waitqueues: Add better annotation

-> #2 (&tty->write_wait){-.-...}:

is a lot more informative than:

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

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: http://lkml.kernel.org/n/tip-8zpopbny51023rdb0qq67eye@git.kernel.org
Signed-off-by: Ingo Molnar <mingo@elte.hu>

authored by

Peter Zijlstra and committed by
Ingo Molnar
f07fdec5 2d2b7749

+4 -4
+2 -2
include/linux/wait.h
··· 77 77 #define __WAIT_BIT_KEY_INITIALIZER(word, bit) \ 78 78 { .flags = word, .bit_nr = bit, } 79 79 80 - extern void __init_waitqueue_head(wait_queue_head_t *q, struct lock_class_key *); 80 + extern void __init_waitqueue_head(wait_queue_head_t *q, const char *name, struct lock_class_key *); 81 81 82 82 #define init_waitqueue_head(q) \ 83 83 do { \ 84 84 static struct lock_class_key __key; \ 85 85 \ 86 - __init_waitqueue_head((q), &__key); \ 86 + __init_waitqueue_head((q), #q, &__key); \ 87 87 } while (0) 88 88 89 89 #ifdef CONFIG_LOCKDEP
+2 -2
kernel/wait.c
··· 10 10 #include <linux/wait.h> 11 11 #include <linux/hash.h> 12 12 13 - void __init_waitqueue_head(wait_queue_head_t *q, struct lock_class_key *key) 13 + void __init_waitqueue_head(wait_queue_head_t *q, const char *name, struct lock_class_key *key) 14 14 { 15 15 spin_lock_init(&q->lock); 16 - lockdep_set_class(&q->lock, key); 16 + lockdep_set_class_and_name(&q->lock, key, name); 17 17 INIT_LIST_HEAD(&q->task_list); 18 18 } 19 19