[Devel] Re: [PATCH net-2.6.26 2/6][NETNS][SOCK]: Introduce per-net inuse counters.
David Miller
davem at davemloft.net
Thu Mar 27 17:38:23 PDT 2008
From: Eric Dumazet <dada1 at cosmosbay.com>
Date: Thu, 27 Mar 2008 21:21:02 +0100
> 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];
> };
I agree mostly, and I'll thus hold off on these patches
until the details are hashed out.
More information about the Devel
mailing list