Skip to content

Commit

Permalink
[NET]: Remove lockdep_set_class() call from skb_queue_head_init().
Browse files Browse the repository at this point in the history
The skb_queue_head_init() function is used both in drivers for private use
and in the core networking code.  The usage models are vastly set of
functions that is only softirq safe; while the driver usage tends to be
more limited to a few hardirq safe accessor functions.  Rather than
annotating all 133+ driver usages, for now just split this lock into a per
queue class.  This change is obviously safe and probably should make
2.6.18.

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Arjan van de Ven authored and David S. Miller committed Aug 2, 2006
1 parent dafee49 commit 76f10ad
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion include/linux/skbuff.h
Original file line number Diff line number Diff line change
Expand Up @@ -606,10 +606,17 @@ static inline __u32 skb_queue_len(const struct sk_buff_head *list_)

extern struct lock_class_key skb_queue_lock_key;

/*
* This function creates a split out lock class for each invocation;
* this is needed for now since a whole lot of users of the skb-queue
* infrastructure in drivers have different locking usage (in hardirq)
* than the networking core (in softirq only). In the long run either the
* network layer or drivers should need annotation to consolidate the
* main types of usage into 3 classes.
*/
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;
}
Expand Down

0 comments on commit 76f10ad

Please sign in to comment.