Skip to content

Commit

Permalink
net: diag: add a scheduling point in inet_diag_dump_icsk()
Browse files Browse the repository at this point in the history
On loaded TCP servers, looking at millions of sockets can hold
cpu for many seconds, if the lookup condition is very narrow.

(eg : ss dst 1.2.3.4 )

Better add a cond_resched() to allow other processes to access
the cpu.

Signed-off-by: Eric Dumazet <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Eric Dumazet authored and davem330 committed Mar 14, 2016
1 parent e3ebd89 commit acffb58
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions net/ipv4/inet_diag.c
Original file line number Diff line number Diff line change
Expand Up @@ -879,6 +879,7 @@ void inet_diag_dump_icsk(struct inet_hashinfo *hashinfo, struct sk_buff *skb,
}

spin_unlock_bh(lock);
cond_resched();
}

done:
Expand Down

0 comments on commit acffb58

Please sign in to comment.