All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: Pavel Emelyanov <xemul@openvz.org>
Cc: Linux Netdev List <netdev@vger.kernel.org>
Subject: Re: [PATCH net-2.6.26][VLAN]: Reduce memory consumed by vlan_group-s.
Date: Thu, 20 Mar 2008 15:22:18 +0100	[thread overview]
Message-ID: <47E2731A.3090401@trash.net> (raw)
In-Reply-To: <47CC2ACF.6080903@openvz.org>

Pavel Emelyanov wrote:
> Currently each vlan_groupd contains 8 pointers on arrays with 512 
> pointers on struct net_device each :) Such a construction "in many 
> cases ... wastes memory".
> 
> My proposal is to allow for some of these arrays pointers be NULL,
> meaning that there are no devices in it. When a new device is added 
> to the vlan_group, the appropriate array is allocated.
> 
> The check in vlan_group_get_device's is safe, since the pointer
> vg->vlan_devices_arrays[x] can only switch from NULL to not-NULL.
> The vlan_group_prealloc_vid() is guarded with rtnl lock and is
> also safe.
> 
> I've checked (I hope that) all the places, that use these arrays 
> and found, that the register_vlan_dev is the only place, that can
> put a vlan device on an empty vlan_group.
> 
> Rough calculations shows, that after the patch a setup with a 
> single vlan dev (or up to 512 vlans with sequential vids) will 
> occupy approximately 8 times less memory.
> 
> The question I have is - does this patch makes sense, or a totally 
> new structures are required to store the vlan_devs?


Its an improvement, so I've applied it, thanks.


  parent reply	other threads:[~2008-03-20 14:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-03 16:43 [PATCH net-2.6.26][VLAN]: Reduce memory consumed by vlan_group-s Pavel Emelyanov
2008-03-18  9:36 ` Pavel Emelyanov
2008-03-20 14:22 ` Patrick McHardy [this message]
2008-03-26 15:12   ` Pavel Emelyanov
2008-03-26 15:39     ` Patrick McHardy
2008-03-26 15:51       ` Pavel Emelyanov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47E2731A.3090401@trash.net \
    --to=kaber@trash.net \
    --cc=netdev@vger.kernel.org \
    --cc=xemul@openvz.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.