]> git.baikalelectronics.ru Git - kernel.git/commit
net/dst: use a smaller percpu_counter batch for dst entries accounting
authorEric Dumazet <edumazet@google.com>
Fri, 8 May 2020 01:58:10 +0000 (18:58 -0700)
committerJakub Kicinski <kuba@kernel.org>
Sat, 9 May 2020 04:33:33 +0000 (21:33 -0700)
commit98e47e174c7628cfa2a63de16788e1b02c9dd454
treec6d0569026ce134c625680f2946b9bbcdb8b0765
parent5d6a4a91a395d40b266a569954271bd83addd58a
net/dst: use a smaller percpu_counter batch for dst entries accounting

percpu_counter_add() uses a default batch size which is quite big
on platforms with 256 cpus. (2*256 -> 512)

This means dst_entries_get_fast() can be off by +/- 2*(nr_cpus^2)
(131072 on servers with 256 cpus)

Reduce the batch size to something more reasonable, and
add logic to ip6_dst_gc() to call dst_entries_get_slow()
before calling the _very_ expensive fib6_run_gc() function.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/net/dst_ops.h
net/core/dst.c
net/ipv6/route.c