Skip to content

Commit 738e6d3

Browse files
edumazetdavem330
authored andcommitted
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>
1 parent db19170 commit 738e6d3

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

net/ipv4/inet_timewait_sock.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,7 @@ void inet_twsk_purge(struct inet_hashinfo *hashinfo,
487487
for (slot = 0; slot <= hashinfo->ehash_mask; slot++) {
488488
struct inet_ehash_bucket *head = &hashinfo->ehash[slot];
489489
restart_rcu:
490+
cond_resched();
490491
rcu_read_lock();
491492
restart:
492493
sk_nulls_for_each_rcu(sk, node, &head->chain) {

0 commit comments

Comments
 (0)