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-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 28 May 2014 07:48:53 -0700
From:	Eric Dumazet <eric.dumazet@...il.com>
To:	sowmini varadhan <sowmini05@...il.com>
Cc:	Jamal Hadi Salim <jhs@...atatu.com>,
	Niels Möller <nisse@...thpole.se>,
	netdev <netdev@...r.kernel.org>, Jonas Bonn <jonas@...thpole.se>,
	Jiri Pirko <jiri@...nulli.us>
Subject: Re: Scaling 'ip addr add' (was Re: What's the right way to use a
 *large* number of source addresses?)

On Wed, 2014-05-28 at 06:44 -0700, Eric Dumazet wrote:
> On Wed, 2014-05-28 at 08:18 -0400, sowmini varadhan wrote:
> > On Tue, May 27, 2014 at 9:41 PM, Eric Dumazet <eric.dumazet@...il.com> wrote:
> > 
> > > Last time I checked, we were spending _lot_ of time in check_lifetime()
> > 
> > Although check_lifetime() itself did not light up in my
> > perf output, i see your point- it has a few ifa_list walks
> > that might end up being expensive - but these are static
> > IPv4 addresses- they should be marked IFA_F_PERMANENT,
> > right? That's probably why they did not show up in my perf output?
> 
> 
> How did you run perf ?
> 
> If you run :
> 
> perf record ./your_script.sh
> 
> It wont catch all the load that is triggered from work queues.
> 
> If you do
> 
> ./your_script.sh &
> 
> perf top
> 
> Then you'll see check_lifetime() at first position.

Following patch helps a lot
(30 seconds to add 65536 addresses on lo interface instead of 52 seconds
on my host)

for i in `seq 0 255`; do for j in `seq 0 255`; do echo "addr add 127.2.$i.$j/8 dev lo"; done; done >batch
ip -b batch

diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index bdbf68bb2e2d..9b9763f27607 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -474,7 +474,8 @@ static int __inet_insert_ifa(struct in_ifaddr *ifa, struct nlmsghdr *nlh,
 	inet_hash_insert(dev_net(in_dev->dev), ifa);
 
 	cancel_delayed_work(&check_lifetime_work);
-	queue_delayed_work(system_power_efficient_wq, &check_lifetime_work, 0);
+	queue_delayed_work(system_power_efficient_wq, &check_lifetime_work,
+			   HZ / 4);
 
 	/* Send message first, then call notifier.
 	   Notifier will trigger FIB update, so that


--
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