netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] tcp/dccp: do not block bh too long in inet_twdr_twkill_work()
@ 2015-04-10 11:19 Eric Dumazet
  2015-04-10 15:31 ` Eric Dumazet
  2015-04-13  1:04 ` David Miller
  0 siblings, 2 replies; 5+ messages in thread
From: Eric Dumazet @ 2015-04-10 11:19 UTC (permalink / raw)
  To: David Miller; +Cc: netdev

From: Eric Dumazet <edumazet@google.com>

I have seen inet_twdr_twkill_work() blocking softirq for
periods up to 1.5 seconds, depending on number of timewait sockets.

This is an unacceptable source of latency.

Note that inet_twdr_do_twkill_work() releases death_lock spinlock
for every tw handled, but does not take care of bh enabling.

Signed-off-by: Eric Dumazet <edumazet@google.com>
---
 net/ipv4/inet_timewait_sock.c |    8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/net/ipv4/inet_timewait_sock.c b/net/ipv4/inet_timewait_sock.c
index 6d592f8555fb..9c7f480d6ad8 100644
--- a/net/ipv4/inet_timewait_sock.c
+++ b/net/ipv4/inet_timewait_sock.c
@@ -303,11 +303,9 @@ void inet_twdr_twkill_work(struct work_struct *work)
 				continue;
 
 			while (inet_twdr_do_twkill_work(twdr, i) != 0) {
-				if (need_resched()) {
-					spin_unlock_bh(&twdr->death_lock);
-					schedule();
-					spin_lock_bh(&twdr->death_lock);
-				}
+				spin_unlock_bh(&twdr->death_lock);
+				cond_resched();
+				spin_lock_bh(&twdr->death_lock);
 			}
 
 			twdr->thread_slots &= ~(1 << i);

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

end of thread, other threads:[~2015-04-13  3:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-10 11:19 [PATCH net] tcp/dccp: do not block bh too long in inet_twdr_twkill_work() Eric Dumazet
2015-04-10 15:31 ` Eric Dumazet
2015-04-13  1:04 ` David Miller
2015-04-13  1:52   ` Eric Dumazet
2015-04-13  3:01     ` 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).