summaryrefslogtreecommitdiff
path: root/include/net
diff options
context:
space:
mode:
authorKuniyuki Iwashima <kuniyu@google.com>2026-09-02 20:36:42 +0000
committerJakub Kicinski <kuba@kernel.org>2026-09-04 15:02:56 -0700
commitcc9bccbad049ec9f1ffa377df60757243ceff2da (patch)
tree50bba165ea95e9efa3f2466bf95ddbbb7e148d2e /include/net
parent6797f12ea40e788c7da47a7cf9ea4a9341548de0 (diff)
selftest: net: Deflake Periodic GC test in test_neigh.sh.
test_neigh.sh has a test case to check if GC is running periodically. It applies a new value to BASE_REACHABLE_TIME, waits for half of the old value (+2s) to ensure the config is reflected, and waits for BASE_REACHABLE_TIME to see if the next GC is triggered. orig_base_reachable=$(ip -j ntable show name "$tbl_name" | jq '.[] | \ select(has("thresh1")) | .["base_reachable"]') run_cmd "ip ntable change name $tbl_name thresh1 10 base_reachable 10000" run_cmd "sleep $(((orig_base_reachable / 1000) / 2 + 2))" This is because neigh_periodic_work() schedules the next GC with (BASE_REACHABLE_TIME / 2) seconds: queue_delayed_work(system_power_efficient_wq, &tbl->gc_work, NEIGH_VAR(&tbl->parms, BASE_REACHABLE_TIME) >> 1); However, the very first run is scheduled with a longer period in neigh_table_init(), which will be up to 45s: neigh_set_reach_time(&tbl->parms); queue_delayed_work(system_power_efficient_wq, &tbl->gc_work, tbl->parms.reachable_time); The initial value is randomly chosen, so if it is larger than 27s (larger than two "sleep"s), the test fails. The test fails more frequently when neigh_table is namespacified by the later patch. In addition, the long "sleep" makes the test more flaky on kernel with CONFIG_NO_HZ_IDLE=y, which is enabled by defconfig. The tbl->gc_work is initialised with INIT_DEFERRABLE_WORK() and queued to system_power_efficient_wq. Even when the next GC is supposed to be triggered 5s later, "sleep" makes the CPU idle, delaying GC execution until often 20s later, which is too late. Let's take the initial tbl->parms.reachable_time into account and poll periodic_gc_runs every 0.1s up to the proper timeout, not to make CPU idle. Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com> Reviewed-by: Nikolay Aleksandrov <razor@blackwall.org> Reviewed-by: Ido Schimmel <idosch@nvidia.com> Link: https://patch.msgid.link/20260902203722.926528-2-kuniyu@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include/net')
0 files changed, 0 insertions, 0 deletions