diff options
author | Eric Dumazet <dada1@cosmosbay.com> | 2008-11-26 04:08:18 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-11-26 04:08:18 -0500 |
commit | 70355602879229c6f8bd694ec9c0814222bc4936 (patch) | |
tree | c970f5b6134fac0c8da11f20ae364c92ae80a8ad /net/core | |
parent | dd24c00191d5e4a1ae896aafe33c6b8095ab4bd1 (diff) |
net: release skb->dst in sock_queue_rcv_skb()
When queuing a skb to sk->sk_receive_queue, we can release its dst,
not anymore needed. Since current cpu did the dst_hold(), refcount is
probably still hot int this cpu caches.
This avoids readers to access the original dst to decrement its
refcount, possibly a long time after packet reception. This should
speedup UDP and RAW receive path.
Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/sock.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/net/core/sock.c b/net/core/sock.c index 7a081b647bf9..b28764558a7d 100644 --- a/net/core/sock.c +++ b/net/core/sock.c | |||
@@ -289,7 +289,11 @@ int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb) | |||
289 | 289 | ||
290 | skb->dev = NULL; | 290 | skb->dev = NULL; |
291 | skb_set_owner_r(skb, sk); | 291 | skb_set_owner_r(skb, sk); |
292 | 292 | /* | |
293 | * release dst right now while its hot | ||
294 | */ | ||
295 | dst_release(skb->dst); | ||
296 | skb->dst = NULL; | ||
293 | /* Cache the SKB length before we tack it onto the receive | 297 | /* Cache the SKB length before we tack it onto the receive |
294 | * queue. Once it is added it no longer belongs to us and | 298 | * queue. Once it is added it no longer belongs to us and |
295 | * may be freed by other threads of control pulling packets | 299 | * may be freed by other threads of control pulling packets |