summaryrefslogtreecommitdiff
path: root/net/ipv4/inet_timewait_sock.c
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2015-03-19 03:40:51 +0300
committerDavid S. Miller <davem@davemloft.net>2015-03-19 05:38:13 +0300
commit738e6d30d392fb75933a5eb4b481811598038786 (patch)
tree768a37f5be81bf3dd1f9453460bb740df122320f /net/ipv4/inet_timewait_sock.c
parentdb19170bc0a254b46c732ea4bdf1c6cf0de6b38b (diff)
downloadlinux-738e6d30d392fb75933a5eb4b481811598038786.tar.xz
inet: add a schedule point in inet_twsk_purge()
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@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/inet_timewait_sock.c')
-rw-r--r--net/ipv4/inet_timewait_sock.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/ipv4/inet_timewait_sock.c b/net/ipv4/inet_timewait_sock.c
index 86ebf020925b..f38e387448fb 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) {