Message ID | 20111222185217.507023273@vyatta.com |
---|---|
State | Accepted, archived |
Delegated to: | David Miller |
Headers | show |
From: Stephen Hemminger <shemminger@vyatta.com> Date: Thu, 22 Dec 2011 10:52:03 -0800 > This patch changes it to yield sooner at halfway instead. Still not a cure-all > for listener overrun if listner is slow, but works much reliably. > > Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Applied. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
--- a/net/netlink/af_netlink.c 2011-12-21 15:15:09.446373421 -0800 +++ b/net/netlink/af_netlink.c 2011-12-21 15:22:35.632062577 -0800 @@ -959,7 +959,7 @@ static int netlink_broadcast_deliver(str skb_set_owner_r(skb, sk); skb_queue_tail(&sk->sk_receive_queue, skb); sk->sk_data_ready(sk, skb->len); - return atomic_read(&sk->sk_rmem_alloc) > sk->sk_rcvbuf; + return atomic_read(&sk->sk_rmem_alloc) > (sk->sk_rcvbuf >> 1); } return -1; }
This patch changes it to yield sooner at halfway instead. Still not a cure-all for listener overrun if listner is slow, but works much reliably. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> --- v2 - use shift to avoid expensive integer division -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html