Netdev List
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: eric.dumazet@gmail.com
Cc: netdev@vger.kernel.org, andi@firstfloor.org,
	linux-kernel@vger.kernel.org, benh@kernel.crashing.org,
	mingo@elte.hu, tj@kernel.org, cl@linux-foundation.org,
	linux-arch@vger.kernel.org
Subject: Re: [PATCH net-next-2.6] snmp: reduce percpu needs by 50%
Date: Sat, 11 Jun 2011 16:24:16 -0700 (PDT)	[thread overview]
Message-ID: <20110611.162416.414198854514319441.davem@davemloft.net> (raw)
In-Reply-To: <1307771151.2872.72.camel@edumazet-laptop>

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Sat, 11 Jun 2011 07:45:51 +0200

> SNMP mibs use two percpu arrays, one used in BH context, another in USER
> context. With increasing number of cpus in machines, and fact that ipv6
> uses per network device ipstats_mib, this is consuming a lot of memory
> if many network devices are registered.
> 
> commit be281e554e2a (ipv6: reduce per device ICMP mib sizes) shrinked
> percpu needs for ipv6, but we can reduce memory use a bit more.
> 
> With recent percpu infrastructure (irqsafe_cpu_inc() ...), we no longer
> need this BH/USER separation since we can update counters in a single
> x86 instruction, regardless of the BH/USER context.
> 
> Other arches than x86 might need to disable irq in their
> irqsafe_cpu_inc() implementation : If this happens to be a problem, we
> can make SNMP_ARRAY_SZ arch dependent, but a previous poll
> ( https://lkml.org/lkml/2011/3/17/174 ) to arch maintainers did not
> raise strong opposition.
> 
> Only on 32bit arches, we need to disable BH for 64bit counters updates
> done from USER context (currently used for IP MIB)
> 
> This also reduces vmlinux size :
> 
> 1) x86_64 build
> $ size vmlinux.before vmlinux.after
>    text	   data	    bss	    dec	    hex	filename
> 7853650	1293772	1896448	11043870	 a8841e	vmlinux.before
> 7850578	1293772	1896448	11040798	 a8781e	vmlinux.after
> 
> 2) i386  build
> $ size vmlinux.before vmlinux.afterpatch 
>    text	   data	    bss	    dec	    hex	filename
> 6039335	 635076	3670016	10344427	 9dd7eb	vmlinux.before
> 6037342	 635076	3670016	10342434	 9dd022	vmlinux.afterpatch
> 
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>

Looks good to me, applied, thanks Eric.

      reply	other threads:[~2011-06-11 23:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1307598598.3980.76.camel@edumazet-laptop>
     [not found] ` <20110609063450.GD15448@one.firstfloor.org>
     [not found]   ` <1307602166.3980.92.camel@edumazet-laptop>
     [not found]     ` <20110608.235113.2177191884416780789.davem@davemloft.net>
2011-06-11  5:45       ` [PATCH net-next-2.6] snmp: reduce percpu needs by 50% Eric Dumazet
2011-06-11 23:24         ` David Miller [this message]

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=20110611.162416.414198854514319441.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=andi@firstfloor.org \
    --cc=benh@kernel.crashing.org \
    --cc=cl@linux-foundation.org \
    --cc=eric.dumazet@gmail.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=netdev@vger.kernel.org \
    --cc=tj@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox