[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1426725651.25985.5.camel@edumazet-glaptop2.roam.corp.google.com>
Date: Wed, 18 Mar 2015 17:40:51 -0700
From: Eric Dumazet <eric.dumazet@...il.com>
To: David Miller <davem@...emloft.net>
Cc: netdev <netdev@...r.kernel.org>
Subject: [PATCH net-next] inet: add a schedule point in inet_twsk_purge()
From: Eric Dumazet <edumazet@...gle.com>
On a large hash table, we can easily spend seconds to
walk over all entries. Add a cond_resched() to yield
cpu if necessary.
Signed-off-by: Eric Dumazet <edumazet@...gle.com>
---
net/ipv4/inet_timewait_sock.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/ipv4/inet_timewait_sock.c b/net/ipv4/inet_timewait_sock.c
index 86ebf020925bd0944e05b912f31e6d694d4c0219..f38e387448fb5596c64cdcb07e7cb06d3e624451 100644
--- a/net/ipv4/inet_timewait_sock.c
+++ b/net/ipv4/inet_timewait_sock.c
@@ -487,6 +487,7 @@ void inet_twsk_purge(struct inet_hashinfo *hashinfo,
for (slot = 0; slot <= hashinfo->ehash_mask; slot++) {
struct inet_ehash_bucket *head = &hashinfo->ehash[slot];
restart_rcu:
+ cond_resched();
rcu_read_lock();
restart:
sk_nulls_for_each_rcu(sk, node, &head->chain) {
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists