瀏覽代碼

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 <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Eric Dumazet 9 年之前
父節點
當前提交
acffb584cd
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      net/ipv4/inet_diag.c

+ 1 - 0
net/ipv4/inet_diag.c

@@ -879,6 +879,7 @@ next_normal:
 		}
 
 		spin_unlock_bh(lock);
+		cond_resched();
 	}
 
 done: