lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1428664747.25985.298.camel@edumazet-glaptop2.roam.corp.google.com>
Date:	Fri, 10 Apr 2015 04:19:07 -0700
From:	Eric Dumazet <eric.dumazet@...il.com>
To:	David Miller <davem@...emloft.net>
Cc:	netdev <netdev@...r.kernel.org>
Subject: [PATCH net] tcp/dccp: do not block bh too long in
 inet_twdr_twkill_work()

From: Eric Dumazet <edumazet@...gle.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@...gle.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);


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ