summaryrefslogtreecommitdiffstats
path: root/include/linux/skbuff.h
diff options
context:
space:
mode:
authorEric Dumazet2016-12-08 20:41:55 +0100
committerDavid S. Miller2016-12-10 04:12:21 +0100
commitc84d949057cab262b4d3110ead9a42a58c2958f7 (patch)
tree000d71e4f8d508764105d9e4d8b20ff86c5b9eab /include/linux/skbuff.h
parentudp: add busylocks in RX path (diff)
downloadkernel-qcow2-linux-c84d949057cab262b4d3110ead9a42a58c2958f7.tar.gz
kernel-qcow2-linux-c84d949057cab262b4d3110ead9a42a58c2958f7.tar.xz
kernel-qcow2-linux-c84d949057cab262b4d3110ead9a42a58c2958f7.zip
udp: copy skb->truesize in the first cache line
In UDP RX handler, we currently clear skb->dev before skb is added to receive queue, because device pointer is no longer available once we exit from RCU section. Since this first cache line is always hot, lets reuse this space to store skb->truesize and thus avoid a cache line miss at udp_recvmsg()/udp_skb_destructor time while receive queue spinlock is held. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/skbuff.h')
-rw-r--r--include/linux/skbuff.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 0cd92b0f2af5..332e76756f54 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -645,8 +645,15 @@ struct sk_buff {
struct rb_node rbnode; /* used in netem & tcp stack */
};
struct sock *sk;
- struct net_device *dev;
+ union {
+ struct net_device *dev;
+ /* Some protocols might use this space to store information,
+ * while device pointer would be NULL.
+ * UDP receive path is one user.
+ */
+ unsigned long dev_scratch;
+ };
/*
* This is the control buffer. It is free to use for every
* layer. Please put your private variables there. If you