From: Ingo Molnar Teach special (multi-initialized) locking code to the lock validator. Has no effect on non-lockdep kernels. Signed-off-by: Ingo Molnar Signed-off-by: Arjan van de Ven Cc: "David S. Miller" Signed-off-by: Andrew Morton --- include/linux/skbuff.h | 3 +++ net/core/skbuff.c | 7 +++++++ 2 files changed, 10 insertions(+) diff -puN include/linux/skbuff.h~lockdep-annotate-skb_queue_head_init include/linux/skbuff.h --- a/include/linux/skbuff.h~lockdep-annotate-skb_queue_head_init +++ a/include/linux/skbuff.h @@ -596,9 +596,12 @@ static inline __u32 skb_queue_len(const return list_->qlen; } +extern struct lock_class_key skb_queue_lock_key; + static inline void skb_queue_head_init(struct sk_buff_head *list) { spin_lock_init(&list->lock); + lockdep_set_class(&list->lock, &skb_queue_lock_key); list->prev = list->next = (struct sk_buff *)list; list->qlen = 0; } diff -puN net/core/skbuff.c~lockdep-annotate-skb_queue_head_init net/core/skbuff.c --- a/net/core/skbuff.c~lockdep-annotate-skb_queue_head_init +++ a/net/core/skbuff.c @@ -72,6 +72,13 @@ static kmem_cache_t *skbuff_head_cache _ static kmem_cache_t *skbuff_fclone_cache __read_mostly; /* + * lockdep: lock class key used by skb_queue_head_init(): + */ +struct lock_class_key skb_queue_lock_key; + +EXPORT_SYMBOL(skb_queue_lock_key); + +/* * Keep out-of-line to prevent kernel bloat. * __builtin_return_address is not used because it is not always * reliable. _