Commit 738e6d30 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

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: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent db19170b
...@@ -487,6 +487,7 @@ void inet_twsk_purge(struct inet_hashinfo *hashinfo, ...@@ -487,6 +487,7 @@ void inet_twsk_purge(struct inet_hashinfo *hashinfo,
for (slot = 0; slot <= hashinfo->ehash_mask; slot++) { for (slot = 0; slot <= hashinfo->ehash_mask; slot++) {
struct inet_ehash_bucket *head = &hashinfo->ehash[slot]; struct inet_ehash_bucket *head = &hashinfo->ehash[slot];
restart_rcu: restart_rcu:
cond_resched();
rcu_read_lock(); rcu_read_lock();
restart: restart:
sk_nulls_for_each_rcu(sk, node, &head->chain) { sk_nulls_for_each_rcu(sk, node, &head->chain) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment