]> git.baikalelectronics.ru Git - kernel.git/commit
net: allocate skbs on local node
authorEric Dumazet <eric.dumazet@gmail.com>
Mon, 11 Oct 2010 19:05:25 +0000 (19:05 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sat, 16 Oct 2010 18:13:19 +0000 (11:13 -0700)
commit77cb43d2a8b81d6a4cc54f2ee3cc26c123def304
treed836fa51848026df74e2bec2b634f1fcf3c6d02f
parent46343859f2682ebdd2b795332034496d563aab81
net: allocate skbs on local node

commit 437ca3f0f8 (node-aware skb allocation) spread a wrong habit of
allocating net drivers skbs on a given memory node : The one closest to
the NIC hardware. This is wrong because as soon as we try to scale
network stack, we need to use many cpus to handle traffic and hit
slub/slab management on cross-node allocations/frees when these cpus
have to alloc/free skbs bound to a central node.

skb allocated in RX path are ephemeral, they have a very short
lifetime : Extra cost to maintain NUMA affinity is too expensive. What
appeared as a nice idea four years ago is in fact a bad one.

In 2010, NIC hardwares are multiqueue, or we use RPS to spread the load,
and two 10Gb NIC might deliver more than 28 million packets per second,
needing all the available cpus.

Cost of cross-node handling in network and vm stacks outperforms the
small benefit hardware had when doing its DMA transfert in its 'local'
memory node at RX time. Even trying to differentiate the two allocations
done for one skb (the sk_buff on local node, the data part on NIC
hardware node) is not enough to bring good performance.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: Tom Herbert <therbert@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/skbuff.h
net/core/skbuff.c