From: Stephen Hemminger <shemminger@vyatta•com>
To: David Miller <davem@davemloft•net>
Cc: netdev@vger•kernel.org
Subject: [PATCH 3/3] netlink: wake up netlink listeners sooner
Date: Wed, 21 Dec 2011 13:49:44 -0800 [thread overview]
Message-ID: <20111221134944.52223cdf@nehalam.linuxnetplumber.net> (raw)
A netlink listening task (such as Quagga/zebra) can easily get overrun
when lots of events happen such as a link state transition with full BGP route
table. This happens because the sender does not yield to the receiver
(unless socket queue is full). The problem is exacerbated because it is
typical for listeners to set large receive buffer to attempt to keep up.
This patch changes it to yield sooner at halfway instead. Still not a cure-all
for listener overrun if listener is slow, but works much reliably.
Signed-off-by: Stephen Hemminger <shemminger@vyatta•com>
--- a/net/netlink/af_netlink.c 2011-12-20 10:25:19.364247598 -0800
+++ b/net/netlink/af_netlink.c 2011-12-20 10:25:46.756570010 -0800
@@ -960,7 +960,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 / 2;
}
return -1;
}
next reply other threads:[~2011-12-21 21:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-21 21:49 Stephen Hemminger [this message]
2011-12-21 23:00 ` [PATCH 3/3] netlink: wake up netlink listeners sooner David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20111221134944.52223cdf@nehalam.linuxnetplumber.net \
--to=shemminger@vyatta$(echo .)com \
--cc=davem@davemloft$(echo .)net \
--cc=netdev@vger$(echo .)kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox