netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] net: diag: add a scheduling point in inet_diag_dump_icsk()
@ 2016-03-14 22:40 Eric Dumazet
  2016-03-14 23:38 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Dumazet @ 2016-03-14 22:40 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev

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>
---
 net/ipv4/inet_diag.c |    1 +
 1 file changed, 1 insertion(+)

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:

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net] net: diag: add a scheduling point in inet_diag_dump_icsk()
  2016-03-14 22:40 [PATCH net] net: diag: add a scheduling point in inet_diag_dump_icsk() Eric Dumazet
@ 2016-03-14 23:38 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2016-03-14 23:38 UTC (permalink / raw)
  To: eric.dumazet; +Cc: netdev

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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-03-14 23:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-14 22:40 [PATCH net] net: diag: add a scheduling point in inet_diag_dump_icsk() Eric Dumazet
2016-03-14 23:38 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).