diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2010-04-16 16:18:22 +0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-04-18 13:39:41 +0400 |
commit | fc6055a5ba31e2c14e36e8939f9bf2b6d586a7f5 (patch) | |
tree | b55954230d0d849d1f7b0517ced4cc1ee6fd8157 /net/core/stream.c | |
parent | 9958da0501fced47c1ac5c5a3a7731c87e45472c (diff) | |
download | linux-fc6055a5ba31e2c14e36e8939f9bf2b6d586a7f5.tar.xz |
net: Introduce skb_orphan_try()
Transmitted skb might be attached to a socket and a destructor, for
memory accounting purposes.
Traditionally, this destructor is called at tx completion time, when skb
is freed.
When tx completion is performed by another cpu than the sender, this
forces some cache lines to change ownership. XPS was an attempt to give
tx completion to initial cpu.
David idea is to call destructor right before giving skb to device (call
to ndo_start_xmit()). Because device queues are usually small, orphaning
skb before tx completion is not a big deal. Some drivers already do
this, we could do it in upper level.
There is one known exception to this early orphaning, called tx
timestamping. It needs to keep a reference to socket until device can
give a hardware or software timestamp.
This patch adds a skb_orphan_try() helper, to centralize all exceptions
to early orphaning in one spot, and use it in dev_hard_start_xmit().
"tbench 16" results on a Nehalem machine (2 X5570 @ 2.93GHz)
before: Throughput 4428.9 MB/sec 16 procs
after: Throughput 4448.14 MB/sec 16 procs
UDP should get even better results, its destructor being more complex,
since SOCK_USE_WRITE_QUEUE is not set (four atomic ops instead of one)
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/stream.c')
0 files changed, 0 insertions, 0 deletions