From: Eric Dumazet Date: Mon, 14 Mar 2016 22:40:00 +0000 (-0700) Subject: net: diag: add a scheduling point in inet_diag_dump_icsk() X-Git-Tag: v4.6-rc1~91^2~36 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=acffb584cda7069b0c2c83045503ccd07516a891;p=linux.git net: diag: add a scheduling point in inet_diag_dump_icsk() 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 Signed-off-by: David S. Miller --- diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c index 50c0d96b8441..5fdb02f5598e 100644 --- a/net/ipv4/inet_diag.c +++ b/net/ipv4/inet_diag.c @@ -879,6 +879,7 @@ void inet_diag_dump_icsk(struct inet_hashinfo *hashinfo, struct sk_buff *skb, } spin_unlock_bh(lock); + cond_resched(); } done: