Commit d94ce9b283736a876b2e6dec665c68e5e8b5d55e

Authored by Eric Dumazet
Committed by David S. Miller
1 parent 0e71c55c9e

ipv4: 16 slots in initial fib_info hash table

A small host typically needs ~10 fib_info structures, so create initial
hash table with 16 slots instead of only one. This removes potential
false sharing and reallocs/rehashes (1->2->4->8->16)

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

net/ipv4/fib_semantics.c
... ... @@ -803,7 +803,7 @@
803 803 unsigned int bytes;
804 804  
805 805 if (!new_size)
806   - new_size = 1;
  806 + new_size = 16;
807 807 bytes = new_size * sizeof(struct hlist_head *);
808 808 new_info_hash = fib_info_hash_alloc(bytes);
809 809 new_laddrhash = fib_info_hash_alloc(bytes);