Message ID | 1457995200.31401.28.camel@edumazet-glaptop3.roam.corp.google.com |
---|---|
State | Accepted, archived |
Delegated to: | David Miller |
Headers | show |
From: Eric Dumazet <eric.dumazet@gmail.com> Date: Mon, 14 Mar 2016 15:40:00 -0700 > From: Eric Dumazet <edumazet@google.com> > > 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> Applied, thanks Eric.
diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c index 6029157..7883473 100644 --- a/net/ipv4/inet_diag.c +++ b/net/ipv4/inet_diag.c @@ -879,6 +879,7 @@ next_normal: } spin_unlock_bh(lock); + cond_resched(); } done: