Skip to content

Commit d94ce9b

Browse files
edumazetdavem330
authored andcommitted
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 0e71c55 commit d94ce9b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/ipv4/fib_semantics.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -803,7 +803,7 @@ struct fib_info *fib_create_info(struct fib_config *cfg)
803803
unsigned int bytes;
804804

805805
if (!new_size)
806-
new_size = 1;
806+
new_size = 16;
807807
bytes = new_size * sizeof(struct hlist_head *);
808808
new_info_hash = fib_info_hash_alloc(bytes);
809809
new_laddrhash = fib_info_hash_alloc(bytes);

0 commit comments

Comments
 (0)