[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHXqBF+vKX9k7QTsO4rhGmzMHVWBEkxMvXwnvYD64O+Dbka2=Q@mail.gmail.com>
Date: Sat, 12 Nov 2011 17:06:40 +0100
From: Michał Mirosław <mirqus@...il.com>
To: David Lamparter <equinox@...c24.net>
Cc: David Miller <davem@...emloft.net>, netdev@...r.kernel.org,
kaber@...sh.net
Subject: Re: [PATCH 1/2] net: vlan: 802.1ad S-VLAN support
2011/11/12 David Lamparter <equinox@...c24.net>:
> On Fri, Nov 11, 2011 at 08:22:35PM -0500, David Miller wrote:
>> > @@ -87,7 +97,8 @@ struct vlan_group {
>> > */
>> > unsigned int nr_vlans;
>> > struct hlist_node hlist; /* linked list */
>> > - struct net_device **vlan_devices_arrays[VLAN_GROUP_ARRAY_SPLIT_PARTS];
>> > + struct net_device **vlan_devices_arrays[VLAN_N_PROTOCOL]
>> > + [VLAN_GROUP_ARRAY_SPLIT_PARTS];
>> > struct rcu_head rcu;
>> > };
>>
>> This is a terrible waste of memory. You're now using 5 times as much space,
>> the vast majority of which will be entirely unused.
>
> VLAN_GROUP_ARRAY_SPLIT_PARTS is 8; so the memory consumption of this was
> previously 8 * ptr = 64 bytes and is now 5 * 8 * ptr = 320 bytes. I thought
> those extra 256 bytes per VLAN-carrying master device are worth the
> simplicity, especially since this saves me impacts on 802.1Q C-VLAN
> lookup performance elsewhere.
I misread this as a table of all VLANs. It doesn't look that terrible
now compared to old scheme. In the case when you have only a handful
of VLANs configured you waste a 4kB per VLAN (but that's how it is
done already).
Best Regards,
Michał Mirosław
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists