All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/2] ipv4: factorize cache clearing for batched unregister operations
@ 2009-11-16 23:49 Octavian Purdila
  2009-11-17  0:06 ` Stephen Hemminger
  2009-11-18 13:04 ` David Miller
  0 siblings, 2 replies; 7+ messages in thread
From: Octavian Purdila @ 2009-11-16 23:49 UTC (permalink / raw)
  To: netdev; +Cc: Eric Dumazet

Signed-off-by: Octavian Purdila <opurdila@ixiacom.com>
---
 net/ipv4/fib_frontend.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c
index 816e218..6c1e56a 100644
--- a/net/ipv4/fib_frontend.c
+++ b/net/ipv4/fib_frontend.c
@@ -895,11 +895,11 @@ static void nl_fib_lookup_exit(struct net *net)
 	net->ipv4.fibnl = NULL;
 }
 
-static void fib_disable_ip(struct net_device *dev, int force)
+static void fib_disable_ip(struct net_device *dev, int force, int delay)
 {
 	if (fib_sync_down_dev(dev, force))
 		fib_flush(dev_net(dev));
-	rt_cache_flush(dev_net(dev), 0);
+	rt_cache_flush(dev_net(dev), delay);
 	arp_ifdown(dev);
 }
 
@@ -922,7 +922,7 @@ static int fib_inetaddr_event(struct notifier_block *this, unsigned long event,
 			/* Last address was deleted from this interface.
 			   Disable IP.
 			 */
-			fib_disable_ip(dev, 1);
+			fib_disable_ip(dev, 1, 0);
 		} else {
 			rt_cache_flush(dev_net(dev), -1);
 		}
@@ -937,7 +937,7 @@ static int fib_netdev_event(struct notifier_block *this, unsigned long event, vo
 	struct in_device *in_dev = __in_dev_get_rtnl(dev);
 
 	if (event == NETDEV_UNREGISTER) {
-		fib_disable_ip(dev, 2);
+		fib_disable_ip(dev, 2, -1);
 		return NOTIFY_DONE;
 	}
 
@@ -955,10 +955,11 @@ static int fib_netdev_event(struct notifier_block *this, unsigned long event, vo
 		rt_cache_flush(dev_net(dev), -1);
 		break;
 	case NETDEV_DOWN:
-		fib_disable_ip(dev, 0);
+		fib_disable_ip(dev, 0, 0);
 		break;
 	case NETDEV_CHANGEMTU:
 	case NETDEV_CHANGE:
+	case NETDEV_UNREGISTER_PERNET:
 		rt_cache_flush(dev_net(dev), 0);
 		break;
 	}
-- 
1.5.6.5


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

* Re: [PATCH 2/2] ipv4: factorize cache clearing for batched unregister operations
  2009-11-16 23:49 [PATCH 2/2] ipv4: factorize cache clearing for batched unregister operations Octavian Purdila
@ 2009-11-17  0:06 ` Stephen Hemminger
  2009-11-17  0:22   ` Benjamin LaHaise
  2009-11-17  7:22   ` Octavian Purdila
  2009-11-18 13:04 ` David Miller
  1 sibling, 2 replies; 7+ messages in thread
From: Stephen Hemminger @ 2009-11-17  0:06 UTC (permalink / raw)
  To: Octavian Purdila; +Cc: netdev, Eric Dumazet

On Tue, 17 Nov 2009 01:49:49 +0200
Octavian Purdila <opurdila@ixiacom.com> wrote:

> Signed-off-by: Octavian Purdila <opurdila@ixiacom.com>
> ---
>  net/ipv4/fib_frontend.c |   11 ++++++-----
>  1 files changed, 6 insertions(+), 5 deletions(-)

And what about IPV6?


-- 

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

* Re: [PATCH 2/2] ipv4: factorize cache clearing for batched unregister operations
  2009-11-17  0:06 ` Stephen Hemminger
@ 2009-11-17  0:22   ` Benjamin LaHaise
  2009-11-17  8:35     ` David Miller
  2009-11-17  7:22   ` Octavian Purdila
  1 sibling, 1 reply; 7+ messages in thread
From: Benjamin LaHaise @ 2009-11-17  0:22 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: Octavian Purdila, netdev, Eric Dumazet

On Mon, Nov 16, 2009 at 04:06:46PM -0800, Stephen Hemminger wrote:
> And what about IPV6?

It's not possible to create more than a few thousand IPv6 interfaces in 
my tests with a 4GB vm.  The culprit seems to be the per-cpu arrays for 
statistics using vmalloc() and wasting gobs of memory as a result (memory 
usage seems to be 10x per interface vs what IPv4 is using), but I haven't 
dug too deeply yet.

		-ben

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

* Re: [PATCH 2/2] ipv4: factorize cache clearing for batched unregister operations
  2009-11-17  0:06 ` Stephen Hemminger
  2009-11-17  0:22   ` Benjamin LaHaise
@ 2009-11-17  7:22   ` Octavian Purdila
  2009-11-17  8:34     ` David Miller
  1 sibling, 1 reply; 7+ messages in thread
From: Octavian Purdila @ 2009-11-17  7:22 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev, Eric Dumazet

On Tuesday 17 November 2009 02:06:46 you wrote:
> On Tue, 17 Nov 2009 01:49:49 +0200
> 
> Octavian Purdila <opurdila@ixiacom.com> wrote:
> > Signed-off-by: Octavian Purdila <opurdila@ixiacom.com>
> > ---
> >  net/ipv4/fib_frontend.c |   11 ++++++-----
> >  1 files changed, 6 insertions(+), 5 deletions(-)
> 
> And what about IPV6?
> 

IPv6 did not appear during profiling my simple dummy test and also a quick scan 
through the code did not reveal anything obvious on the unregister path which 
could be factorized.

BTW, it appears we don't have a route cache for IPv6. Right?

I known we will run into other scalability issues when we  will set IPv4/IPv6 
addresses, and that is one of the next items on my list to profile :)


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

* Re: [PATCH 2/2] ipv4: factorize cache clearing for batched unregister operations
  2009-11-17  7:22   ` Octavian Purdila
@ 2009-11-17  8:34     ` David Miller
  0 siblings, 0 replies; 7+ messages in thread
From: David Miller @ 2009-11-17  8:34 UTC (permalink / raw)
  To: opurdila; +Cc: shemminger, netdev, eric.dumazet

From: Octavian Purdila <opurdila@ixiacom.com>
Date: Tue, 17 Nov 2009 09:22:08 +0200

> BTW, it appears we don't have a route cache for IPv6. Right?

That's right, no IPV6 route cache.

But it doesn't seem to matter so much, as routing tables are
still small in that realm.  Although I heard the trend is for
that to change.

I also suspect that with things like policy routing we could run into
problems, but we have a multi-way tree for the IPV6 routing table
datastructure explicitly to handle those kinds of things.

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

* Re: [PATCH 2/2] ipv4: factorize cache clearing for batched unregister operations
  2009-11-17  0:22   ` Benjamin LaHaise
@ 2009-11-17  8:35     ` David Miller
  0 siblings, 0 replies; 7+ messages in thread
From: David Miller @ 2009-11-17  8:35 UTC (permalink / raw)
  To: bcrl; +Cc: shemminger, opurdila, netdev, eric.dumazet

From: Benjamin LaHaise <bcrl@lhnet.ca>
Date: Mon, 16 Nov 2009 19:22:38 -0500

> It's not possible to create more than a few thousand IPv6 interfaces in 
> my tests with a 4GB vm.  The culprit seems to be the per-cpu arrays for 
> statistics using vmalloc() and wasting gobs of memory as a result (memory 
> usage seems to be 10x per interface vs what IPv4 is using), but I haven't 
> dug too deeply yet.

That definitely should be fixed.

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

* Re: [PATCH 2/2] ipv4: factorize cache clearing for batched unregister operations
  2009-11-16 23:49 [PATCH 2/2] ipv4: factorize cache clearing for batched unregister operations Octavian Purdila
  2009-11-17  0:06 ` Stephen Hemminger
@ 2009-11-18 13:04 ` David Miller
  1 sibling, 0 replies; 7+ messages in thread
From: David Miller @ 2009-11-18 13:04 UTC (permalink / raw)
  To: opurdila; +Cc: netdev, eric.dumazet

From: Octavian Purdila <opurdila@ixiacom.com>
Date: Tue, 17 Nov 2009 01:49:49 +0200

> Signed-off-by: Octavian Purdila <opurdila@ixiacom.com>

Applied to net-next-2.6

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

end of thread, other threads:[~2009-11-18 13:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-16 23:49 [PATCH 2/2] ipv4: factorize cache clearing for batched unregister operations Octavian Purdila
2009-11-17  0:06 ` Stephen Hemminger
2009-11-17  0:22   ` Benjamin LaHaise
2009-11-17  8:35     ` David Miller
2009-11-17  7:22   ` Octavian Purdila
2009-11-17  8:34     ` David Miller
2009-11-18 13:04 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.