Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ed6cd6a

Browse files
borkmannkuba-moo
authored andcommitted
net, neigh: Set lower cap for neigh_managed_work rearming
Yuwei reported that plain reuse of DELAY_PROBE_TIME to rearm work queue in neigh_managed_work is problematic if user explicitly configures the DELAY_PROBE_TIME to 0 for a neighbor table. Such misconfig can then hog CPU to 100% processing the system work queue. Instead, set lower interval bound to HZ which is totally sufficient. Yuwei is additionally looking into making the interval separately configurable from DELAY_PROBE_TIME. Reported-by: Yuwei Wang <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Link: https://lore.kernel.org/netdev/[email protected] Reviewed-by: Nikolay Aleksandrov <[email protected]> Link: https://lore.kernel.org/r/3b8c5aa906c52c3a8c995d1b2e8ccf650ea7c716.1653432794.git.daniel@iogearbox.net Signed-off-by: Jakub Kicinski <[email protected]>
1 parent b3b1a17 commit ed6cd6a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/core/neighbour.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1579,7 +1579,7 @@ static void neigh_managed_work(struct work_struct *work)
15791579
list_for_each_entry(neigh, &tbl->managed_list, managed_list)
15801580
neigh_event_send_probe(neigh, NULL, false);
15811581
queue_delayed_work(system_power_efficient_wq, &tbl->managed_work,
1582-
NEIGH_VAR(&tbl->parms, DELAY_PROBE_TIME));
1582+
max(NEIGH_VAR(&tbl->parms, DELAY_PROBE_TIME), HZ));
15831583
write_unlock_bh(&tbl->lock);
15841584
}
15851585

0 commit comments

Comments
 (0)