From: Stephen Hemminger <stephen@networkplumber.org>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Subject: [PATCH net] netlink: call cond_resched after broadcasting updates
Date: Sat, 27 Dec 2014 09:54:33 -0800 [thread overview]
Message-ID: <20141227095433.00333deb@urahara> (raw)
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 <stephen@networkplumber.org>
--- a/net/netlink/af_netlink.c 2014-12-27 09:43:06.705792634 -0800
+++ b/net/netlink/af_netlink.c 2014-12-27 09:43:06.705792634 -0800
@@ -1983,8 +1983,10 @@ int netlink_broadcast_filtered(struct so
netlink_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);
next reply other threads:[~2014-12-27 17:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-27 17:54 Stephen Hemminger [this message]
2014-12-31 23:38 ` [PATCH net] netlink: call cond_resched after broadcasting updates David Miller
-- strict thread matches above, loose matches on Subject: below --
2014-12-28 7:28 Sedat Dilek
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=20141227095433.00333deb@urahara \
--to=stephen@networkplumber.org \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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