From 0a463c78d25b9464b77311d9dda297550a2d6aa5 Mon Sep 17 00:00:00 2001 From: Paolo Abeni Date: Mon, 12 Jun 2017 11:23:42 +0200 Subject: udp: avoid a cache miss on dequeue Since UDP no more uses sk->destructor, we can clear completely the skb head state before enqueuing. Amend and use skb_release_head_state() for that. All head states share a single cacheline, which is not normally used/accesses on dequeue. We can avoid entirely accessing such cacheline implementing and using in the UDP code a specialized skb free helper which ignores the skb head state. This saves a cacheline miss at skb deallocation time. v1 -> v2: replaced secpath_reset() with skb_release_head_state() Signed-off-by: Paolo Abeni Acked-by: Eric Dumazet Signed-off-by: David S. Miller --- include/linux/skbuff.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/linux/skbuff.h') diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index decce3655a48..d66d4feaac86 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -880,10 +880,12 @@ static inline bool skb_unref(struct sk_buff *skb) return true; } +void skb_release_head_state(struct sk_buff *skb); void kfree_skb(struct sk_buff *skb); void kfree_skb_list(struct sk_buff *segs); void skb_tx_error(struct sk_buff *skb); void consume_skb(struct sk_buff *skb); +void consume_stateless_skb(struct sk_buff *skb); void __kfree_skb(struct sk_buff *skb); extern struct kmem_cache *skbuff_head_cache; -- cgit v1.2.3-55-g7522