]> git.baikalelectronics.ru Git - kernel.git/commit
fib_hash: embed initial hash table in fn_zone
authorEric Dumazet <eric.dumazet@gmail.com>
Thu, 14 Oct 2010 20:53:04 +0000 (20:53 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sun, 17 Oct 2010 20:53:15 +0000 (13:53 -0700)
commitf7704af81cb40e1de1f6b473da753d8a80d004a4
treece61ab76bce8de53b76a83ec3cca63a87b7286b7
parent7bdc2450960c88ce0781ebe244747db75daa0b1e
fib_hash: embed initial hash table in fn_zone

While looking for false sharing problems, I noticed
sizeof(struct fn_zone) was small (28 bytes) and possibly sharing a cache
line with an often written kernel structure.

Most of the time, fn_zone uses its initial hash table of 16 slots.

We can avoid the false sharing problem by embedding this initial hash
table in fn_zone itself, so that sizeof(fn_zone) > L1_CACHE_BYTES

We did a similar optimization in commit c8c0758958 (Reduce memory needs
and speedup lookups)

Add a fz_revorder field to speedup fn_hash() a bit.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/fib_hash.c