1
0
Files
linux/include/net
Eric Dumazet c7d4426a98 net: introduce DST_NOCACHE flag
While doing stress tests with IP route cache disabled, and multi queue
devices, I noticed a very high contention on one rwlock used in
neighbour code.

When many cpus are trying to send frames (possibly using a high
performance multiqueue device) to the same neighbour, they fight for the
neigh->lock rwlock in order to call neigh_hh_init(), and fight on
hh->hh_refcnt (a pair of atomic_inc/atomic_dec_and_test())

But we dont need to call neigh_hh_init() for dst that are used only
once. It costs four atomic operations at least, on two contended cache
lines, plus the high contention on neigh->lock rwlock.

Introduce a new dst flag, DST_NOCACHE, that is set when dst was not
inserted in route cache.

With the stress test bench, sending 160000000 frames on one neighbour,
results are :

Before patch:

real	2m28.406s
user	0m11.781s
sys	36m17.964s


After patch:

real	1m26.532s
user	0m12.185s
sys	20m3.903s

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-10-03 22:17:54 -07:00
..
2010-08-02 14:28:34 -05:00
2010-09-23 14:33:39 -07:00
2010-09-23 14:33:39 -07:00
2010-09-23 14:33:39 -07:00
2010-09-23 14:33:39 -07:00
2009-11-04 05:06:25 -08:00
2010-06-03 03:21:52 -07:00
2010-06-03 03:21:52 -07:00
2009-09-01 17:40:31 -07:00
2010-10-03 22:17:54 -07:00
2009-11-04 05:06:25 -08:00
2010-06-02 05:16:23 -07:00
2010-09-23 14:33:39 -07:00
2010-04-13 01:41:33 -07:00
2010-06-03 03:21:52 -07:00
2010-09-08 10:39:57 -07:00
2010-09-23 14:33:39 -07:00
2010-09-27 21:30:42 -07:00
2010-09-23 14:33:39 -07:00
2010-06-03 03:21:52 -07:00
2009-12-26 20:46:28 -08:00
2010-06-03 03:21:52 -07:00
2010-06-03 03:21:52 -07:00
2010-03-12 15:52:40 -08:00
2010-06-23 12:58:40 -07:00
2009-11-20 15:35:04 -08:00
2009-11-04 05:06:25 -08:00
2009-07-26 19:11:14 -07:00
2010-06-10 23:31:35 -07:00
2010-09-23 14:33:39 -07:00
2010-06-30 13:31:19 -07:00
2010-09-26 18:53:07 -07:00
2010-09-08 21:45:01 -07:00
2009-10-07 16:39:43 -04:00