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@xxxxxxxxx> 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@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html