David S. Miller a écrit :

There are tons of pieces of state tracked for net devices
which we don't export to userland.

This one is generally useful.  Right now, it may be the case
that bonding is the only consumer in the kernel, but that
might not always be true.  I can very easily envison uses
by the packet scheduler and classifiers.

This optimization is truly erroneous, and I think people are going
waaay over the top wrt. optimizing the loopback interface on SMP.


I had this idea after reading recent Van Jacobson paper about net channels.

I'm surprised you see the benefit of net channels (which first assumption is about the 50-100 ns cost of a memory cache miss) but keep this obvious cache line ping pong in loopback driver.

I did a benchmark test, using the volano benchmark (http://www.volano.com/report/index.html)

Platform : Dell PowerEdge 1600 SC with two Intel Xeon HT 2.0GHz cpu (total of 4 logical cpus), FSB 533MHz, 2GB of ram.

java version "1.5.0_06"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
Java HotSpot(TM) Server VM (build 1.5.0_06-b05, mixed mode)


Normal 2.6.16-rc2    (with dev->last_rx=jiffies in loopback driver)

VolanoMark version = 2.5.0.9
Messages sent      = 20000
Messages received  = 380000
Total messages     = 400000
Elapsed time       = 27.239 seconds
Average throughput = 14685 messages per second
VolanoMark version = 2.5.0.9
Messages sent      = 20000
Messages received  = 380000
Total messages     = 400000
Elapsed time       = 24.871 seconds
Average throughput = 16083 messages per second
VolanoMark version = 2.5.0.9
Messages sent      = 20000
Messages received  = 380000
Total messages     = 400000
Elapsed time       = 28.698 seconds
Average throughput = 13938 messages per second
VolanoMark version = 2.5.0.9
Messages sent      = 20000
Messages received  = 380000
Total messages     = 400000
Elapsed time       = 24.302 seconds
Average throughput = 16460 messages per second

total time = 108.956


Patched 2.6.16-rc2 kernel (without dev->last_rx=jiffies; in loopback driver)

VolanoMark version = 2.5.0.9
Messages sent      = 20000
Messages received  = 380000
Total messages     = 400000
Elapsed time       = 26.3 seconds
Average throughput = 15209 messages per second
VolanoMark version = 2.5.0.9
Messages sent      = 20000
Messages received  = 380000
Total messages     = 400000
Elapsed time       = 25.056 seconds
Average throughput = 15964 messages per second
VolanoMark version = 2.5.0.9
Messages sent      = 20000
Messages received  = 380000
Total messages     = 400000
Elapsed time       = 24.62 seconds
Average throughput = 16247 messages per second
VolanoMark version = 2.5.0.9
Messages sent      = 20000
Messages received  = 380000
Total messages     = 400000
Elapsed time       = 23.609 seconds
Average throughput = 16943 messages per second

total time = 105.2

If I add the "dont refcount loopback netdevice" patch :

VolanoMark version = 2.5.0.9
Messages sent      = 20000
Messages received  = 380000
Total messages     = 400000
Elapsed time       = 29.571 seconds
Average throughput = 13527 messages per second
VolanoMark version = 2.5.0.9
Messages sent      = 20000
Messages received  = 380000
Total messages     = 400000
Elapsed time       = 23.993 seconds
Average throughput = 16672 messages per second
VolanoMark version = 2.5.0.9
Messages sent      = 20000
Messages received  = 380000
Total messages     = 400000
Elapsed time       = 24.111 seconds
Average throughput = 16590 messages per second
VolanoMark version = 2.5.0.9
Messages sent      = 20000
Messages received  = 380000
Total messages     = 400000
Elapsed time       = 24.68 seconds
Average throughput = 16207 messages per second

total = 102.355

Of course this is a benchmark, but normally used to test the OS capacity to switch threads, not 'loopback performance'


-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to