Commit 6bb432e9 authored by Eric Dumazet's avatar Eric Dumazet Committed by Dong Chenchen
Browse files

net/dst: use a smaller percpu_counter batch for dst entries accounting

stable inclusion
from stable-v4.19.304
commit 9635bd0a5296e2e725c6b33e530d0ef582e2f64e
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I90HST

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=9635bd0a5296e2e725c6b33e530d0ef582e2f64e



--------------------------------

commit cf86a086 upstream.

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: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
Signed-off-by: default avatarSuraj Jitindar Singh <surajjs@amazon.com>
Cc: <stable@vger.kernel.org> # 4.19.x
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarDong Chenchen <dongchenchen2@huawei.com>
parent f5703759
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment