Re: [PATCH] NET : SMP optimization of netdevice refcount

2006-02-08 Thread Andi Kleen
On Thursday 09 February 2006 00:07, David Stevens wrote: > From: Stephen Hemminger <[EMAIL PROTECTED]> > > > IMHO converting skb->dev to skb->devindex and using ifindex sounds best. > > It gets rid of the need to refcount as much but keeps the safety from > > buggy protocols. Ipv6 could probably

Re: [PATCH] NET : SMP optimization of netdevice refcount

2006-02-08 Thread David Stevens
From: Stephen Hemminger <[EMAIL PROTECTED]> > IMHO converting skb->dev to skb->devindex and using ifindex sounds best. > It gets rid of the need to refcount as much but keeps the safety from > buggy protocols. Ipv6 could probably use ifindex as well. A couple years ago, we identified a p

Re: [PATCH] NET : SMP optimization of netdevice refcount

2006-02-08 Thread David S. Miller
From: Andi Kleen <[EMAIL PROTECTED]> Date: Wed, 8 Feb 2006 23:20:38 +0100 > But are you sure the hash table used for that would be strong enough > to handle the load? With RCU locking I think it is. > And what happens when a ifindex is reused? Then packets could end up > on the wrong interface.

Re: [PATCH] NET : SMP optimization of netdevice refcount

2006-02-08 Thread Andi Kleen
On Wednesday 08 February 2006 20:12, Stephen Hemminger wrote: > On Tue, 07 Feb 2006 16:26:01 -0800 (PST) > "David S. Miller" <[EMAIL PROTECTED]> wrote: > > > From: Stephen Hemminger <[EMAIL PROTECTED]> > > Date: Tue, 7 Feb 2006 16:19:42 -0800 > > > > > Also, isn't a lot of the problem reduced if

Re: [PATCH] NET : SMP optimization of netdevice refcount

2006-02-08 Thread Ben Greear
Stephen Hemminger wrote: On Wed, 08 Feb 2006 11:24:24 -0800 Ben Greear <[EMAIL PROTECTED]> wrote: Stephen Hemminger wrote: On Tue, 07 Feb 2006 16:26:01 -0800 (PST) "David S. Miller" <[EMAIL PROTECTED]> wrote: From: Stephen Hemminger <[EMAIL PROTECTED]> Date: Tue, 7 Feb 2006 16:19:42 -080

Re: [PATCH] NET : SMP optimization of netdevice refcount

2006-02-08 Thread Arnaldo Carvalho de Melo
On 2/8/06, Stephen Hemminger <[EMAIL PROTECTED]> wrote: > On Wed, 08 Feb 2006 11:24:24 -0800 > Ben Greear <[EMAIL PROTECTED]> wrote: > > > Stephen Hemminger wrote: > > > On Tue, 07 Feb 2006 16:26:01 -0800 (PST) > > > "David S. Miller" <[EMAIL PROTECTED]> wrote: > > > > > > > > >>From: Stephen Hemmi

Re: [PATCH] NET : SMP optimization of netdevice refcount

2006-02-08 Thread Stephen Hemminger
On Wed, 08 Feb 2006 11:24:24 -0800 Ben Greear <[EMAIL PROTECTED]> wrote: > Stephen Hemminger wrote: > > On Tue, 07 Feb 2006 16:26:01 -0800 (PST) > > "David S. Miller" <[EMAIL PROTECTED]> wrote: > > > > > >>From: Stephen Hemminger <[EMAIL PROTECTED]> > >>Date: Tue, 7 Feb 2006 16:19:42 -0800 > >>

Re: [PATCH] NET : SMP optimization of netdevice refcount

2006-02-08 Thread Ben Greear
Stephen Hemminger wrote: On Tue, 07 Feb 2006 16:26:01 -0800 (PST) "David S. Miller" <[EMAIL PROTECTED]> wrote: From: Stephen Hemminger <[EMAIL PROTECTED]> Date: Tue, 7 Feb 2006 16:19:42 -0800 Also, isn't a lot of the problem reduced if network devices are affinitied? Not for routing/firew

Re: [PATCH] NET : SMP optimization of netdevice refcount

2006-02-08 Thread Stephen Hemminger
On Tue, 07 Feb 2006 16:26:01 -0800 (PST) "David S. Miller" <[EMAIL PROTECTED]> wrote: > From: Stephen Hemminger <[EMAIL PROTECTED]> > Date: Tue, 7 Feb 2006 16:19:42 -0800 > > > Also, isn't a lot of the problem reduced if network devices > > are affinitied? > > Not for routing/firewalling, we tou

Re: [PATCH] NET : SMP optimization of netdevice refcount

2006-02-08 Thread Andi Kleen
On Wednesday 08 February 2006 11:34, Eric Dumazet wrote: > 1) Instead of storing a 2-uple {pointer,generation} (and using 12 or 16 bytes > on 64 bits platforms), we could just use a 32 bit quantity > [(ifindex<<8)+(gen_number)] That would add an 2^24 netdevice limit. Someone will sooner or late

Re: [PATCH] NET : SMP optimization of netdevice refcount

2006-02-08 Thread Eric Dumazet
Andi Kleen a écrit : On Wednesday 08 February 2006 01:44, David S. Miller wrote: From: Ben Greear <[EMAIL PROTECTED]> Date: Tue, 07 Feb 2006 16:39:52 -0800 Rick Jones wrote: In the realm of straw ideas, how often are netdevs added and removed, and would leaving a tombstone behind consume too

Re: [PATCH] NET : SMP optimization of netdevice refcount

2006-02-08 Thread Andi Kleen
On Wednesday 08 February 2006 01:44, David S. Miller wrote: > From: Ben Greear <[EMAIL PROTECTED]> > Date: Tue, 07 Feb 2006 16:39:52 -0800 > > > Rick Jones wrote: > > > In the realm of straw ideas, how often are netdevs added and removed, > > > and would leaving a tombstone behind consume too muc

Re: [PATCH] NET : SMP optimization of netdevice refcount

2006-02-07 Thread Ben Greear
Rick Jones wrote: Ben Greear wrote: Rick Jones wrote: In the realm of straw ideas, how often are netdevs added and removed, and would leaving a tombstone behind consume too much memory? In certain cases...say, with vlans, you could very often create and destroy net devices. I think that

Re: [PATCH] NET : SMP optimization of netdevice refcount

2006-02-07 Thread Rick Jones
David S. Miller wrote: From: Ben Greear <[EMAIL PROTECTED]> Date: Tue, 07 Feb 2006 16:39:52 -0800 Rick Jones wrote: In the realm of straw ideas, how often are netdevs added and removed, and would leaving a tombstone behind consume too much memory? In certain cases...say, with vlans, you co

Re: [PATCH] NET : SMP optimization of netdevice refcount

2006-02-07 Thread Rick Jones
Ben Greear wrote: Rick Jones wrote: In the realm of straw ideas, how often are netdevs added and removed, and would leaving a tombstone behind consume too much memory? In certain cases...say, with vlans, you could very often create and destroy net devices. I think that giving up and leaking

Re: [PATCH] NET : SMP optimization of netdevice refcount

2006-02-07 Thread Ben Greear
David S. Miller wrote: From: Ben Greear <[EMAIL PROTECTED]> Date: Tue, 07 Feb 2006 15:54:06 -0800 What do you think about having no ref counting, and upon removal of a network device, we notify each logic unit that deals with skbs or other things that link to the netdev and ask it to clean all

Re: [PATCH] NET : SMP optimization of netdevice refcount

2006-02-07 Thread Rick Jones
David S. Miller wrote: From: Rick Jones <[EMAIL PROTECTED]> Date: Tue, 07 Feb 2006 16:29:34 -0800 In the realm of straw ideas, how often are netdevs added and removed, and would leaving a tombstone behind consume too much memory? That could work. Another idea is to revisit the scheme of st

Re: [PATCH] NET : SMP optimization of netdevice refcount

2006-02-07 Thread David S. Miller
From: Ben Greear <[EMAIL PROTECTED]> Date: Tue, 07 Feb 2006 16:39:52 -0800 > Rick Jones wrote: > > In the realm of straw ideas, how often are netdevs added and removed, > > and would leaving a tombstone behind consume too much memory? > > In certain cases...say, with vlans, you could very often

Re: [PATCH] NET : SMP optimization of netdevice refcount

2006-02-07 Thread Ben Greear
Rick Jones wrote: In the realm of straw ideas, how often are netdevs added and removed, and would leaving a tombstone behind consume too much memory? In certain cases...say, with vlans, you could very often create and destroy net devices. I think that giving up and leaking the memory is not a

Re: [PATCH] NET : SMP optimization of netdevice refcount

2006-02-07 Thread David S. Miller
From: Rick Jones <[EMAIL PROTECTED]> Date: Tue, 07 Feb 2006 16:29:34 -0800 > In the realm of straw ideas, how often are netdevs added and > removed, and would leaving a tombstone behind consume too much > memory? That could work. Another idea is to revisit the scheme of storing just the ifindex

Re: [PATCH] NET : SMP optimization of netdevice refcount

2006-02-07 Thread Rick Jones
In the realm of straw ideas, how often are netdevs added and removed, and would leaving a tombstone behind consume too much memory? rick jones - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.ker

Re: [PATCH] NET : SMP optimization of netdevice refcount

2006-02-07 Thread David S. Miller
From: Stephen Hemminger <[EMAIL PROTECTED]> Date: Tue, 7 Feb 2006 16:19:42 -0800 > Also, isn't a lot of the problem reduced if network devices > are affinitied? Not for routing/firewalling, we touch the destination device's counters on input softing of the source device. - To unsubscribe from thi

Re: [PATCH] NET : SMP optimization of netdevice refcount

2006-02-07 Thread Stephen Hemminger
On Tue, 07 Feb 2006 16:11:51 -0800 (PST) "David S. Miller" <[EMAIL PROTECTED]> wrote: > From: Ben Greear <[EMAIL PROTECTED]> > Date: Tue, 07 Feb 2006 15:54:06 -0800 > > > What do you think about having no ref counting, and upon removal of > > a network device, we notify each logic unit that deals

Re: [PATCH] NET : SMP optimization of netdevice refcount

2006-02-07 Thread David S. Miller
From: Ben Greear <[EMAIL PROTECTED]> Date: Tue, 07 Feb 2006 15:54:06 -0800 > What do you think about having no ref counting, and upon removal of > a network device, we notify each logic unit that deals with skbs > or other things that link to the netdev and ask it to clean all > references to the

Re: [PATCH] NET : SMP optimization of netdevice refcount

2006-02-07 Thread Ben Greear
Eric Dumazet wrote: David S. Miller a écrit : From: Eric Dumazet <[EMAIL PROTECTED]> Date: Wed, 08 Feb 2006 00:23:45 +0100 Some devices are *never* unregistered : loopback, or statically linked drivers, thus we are refcounting them for nothing. Statically linked drivers can have netdev's t

Re: [PATCH] NET : SMP optimization of netdevice refcount

2006-02-07 Thread Eric Dumazet
David S. Miller a écrit : From: Eric Dumazet <[EMAIL PROTECTED]> Date: Wed, 08 Feb 2006 00:23:45 +0100 Some devices are *never* unregistered : loopback, or statically linked drivers, thus we are refcounting them for nothing. Statically linked drivers can have netdev's that get unregistered an

Re: [PATCH] NET : SMP optimization of netdevice refcount

2006-02-07 Thread David S. Miller
From: Eric Dumazet <[EMAIL PROTECTED]> Date: Wed, 08 Feb 2006 00:23:45 +0100 > Some devices are *never* unregistered : loopback, or statically linked > drivers, thus we are refcounting them for nothing. Statically linked drivers can have netdev's that get unregistered and free'd up. For example

[PATCH] NET : SMP optimization of netdevice refcount

2006-02-07 Thread Eric Dumazet
Struct net_device's atomic refcnt are probably one of the hotest memory spots in a SMP/NUMA network router or network server. This counter is constantly incremented/decremented each time a network packet is handled, or a IP route is added/deleted in route cache. This is *not* SMP nor NUMA frie