netlink: call cond_resched after broadcasting updates
Subsystems (2)
PATCH 1/1 netlink: call cond_resched after broadcasting updates
When a netlink event is posted to a socket, the receiving process maybe waiting to wakeup. Reduce the latency by calling cond_resched() in this loop. This reduces the problems with missed events during a netlink storm such as when a routing daemon does mass update in response to a link transition.
net/netlink/af_netlink.c +3 -1
@@ -1983,8 +1983,10 @@ int netlink_broadcast_filtered(struct sonetlink_lock_table (); -sk_for_each_bound (sk, &nl_table[ssk->sk_protocol].mc_list) +sk_for_each_bound (sk, &nl_table[ssk->sk_protocol].mc_list) {do_one_broadcast (sk, &info); +cond_resched (); + }consume_skb (skb);
David Miller
maintainerFrom: Stephen Hemminger <[email protected]>
Date: Sat, 27 Dec 2014 09:54:33 -0800
Quoted 7 lines
When a netlink event is posted to a socket, the receiving process maybe waiting to wakeup. Reduce the latency by calling
cond_resched()in this loop. This reduces the problems with missed events during a netlink storm such as when a routing daemon does mass update in response to a link transition.Signed-off-by Stephen Hemminger <[email protected]>
As mentioned by others, this is potentially invoked from software interrupts generating netlink events (one example is ipv6) so we can't try to conditionally sleep here.