Re: [PATCH net-2.6.26 2/6][NETNS][SOCK]: Introduce per-net inuse counters.

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Pavel Emelyanov <xemul@...>
Cc: David Miller <davem@...>, Linux Netdev List <netdev@...>, <devel@...>
Date: Thursday, March 27, 2008 - 4:21 pm

Pavel Emelyanov a écrit :

Given that :

1) pcounter should really go away from kernel, since Andrew disagree 
with the implementation.

2) the need to enumerate all protocols in your enum, it seems ... ugly :)

3) alloc_percpu(struct net_prot_inuse) per net is nice because we dont 
waste memory (if we had to use percpu_counters for each proto for example)

I suggest to :

1) not use pcounter anymore

2) change 'inuse' field to 'inuse_idx' or 'prot_num' that is 
automatically allocated at proto_register time, instead statically at 
compile time.

Just provide a big enough NET_INUSE_NR (might depend on IPV6 present or 
not, static or module) to take into account all possible protocols.

struct net_prot_inuse {
	int val[NET_INUSE_NR];
};






--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH net-2.6.26 2/6][NETNS][SOCK]: Introduce per-net i..., Eric Dumazet, (Thu Mar 27, 4:21 pm)