Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1215608

Re: [PATCH RFC V2 2/2] net: Optimize snmp stat aggregation by walking all the percpu data at once

Path csiph.com!eternal-september.org!feeder.eternal-september.org!aioe.org!bofh.it!news.nic.it!robomod
From Joe Perches <joe@perches.com>
Newsgroups linux.kernel
Subject Re: [PATCH RFC V2 2/2] net: Optimize snmp stat aggregation by walking all the percpu data at once
Date Sat, 29 Aug 2015 01:20:02 +0200
Message-ID <q2B6a-Rf-11@gated-at.bofh.it> (permalink)
References <q1MZI-4is-21@gated-at.bofh.it> <q2afE-4d2-29@gated-at.bofh.it> <q2luq-3FD-17@gated-at.bofh.it> <q2wzw-2Pm-15@gated-at.bofh.it> <q2xvA-4aI-15@gated-at.bofh.it> <q2yBj-5Er-7@gated-at.bofh.it> <q2yUF-60W-3@gated-at.bofh.it> <q2yUF-60W-1@gated-at.bofh.it> <q2z4m-6rs-11@gated-at.bofh.it> <q2ze2-6CP-11@gated-at.bofh.it> <q2znJ-6NW-23@gated-at.bofh.it> <q2AjL-89a-5@gated-at.bofh.it>
X-Original-To Eric Dumazet <eric.dumazet@gmail.com>
X-Session-Marker 6A6F6540706572636865732E636F6D
X-Spam-Summary 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::::::::::::::::::::::::::::,RULES_HIT:41:355:379:541:599:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2553:2559:2562:2691:2693:2828:3138:3139:3140:3141:3142:3353:3622:3865:3866:3867:3868:3870:3871:3872:3873:3874:4321:5007:6119:6120:6261:6742:7901:7903:10004:10400:10450:10455:10848:11232:11658:11914:12517:12519:12740:13069:13255:13311:13357:14096:14097:19904:19999:21080,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0
X-He-Tag hair51_54305ff12c10f
X-Filterd-Recvd-Size 3143
Content-Type text/plain; charset="ISO-8859-1"
X-Mailer Evolution 3.12.11-0ubuntu3
MIME-Version 1.0
Content-Transfer-Encoding 7bit
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 40
Organization linux.* mail to news gateway
X-Original-Cc David Miller <davem@davemloft.net>, raghavendra.kt@linux.vnet.ibm.com, edumazet@google.com, kuznet@ms2.inr.ac.ru, jmorris@namei.org, yoshfuji@linux-ipv6.org, kaber@trash.net, jiri@resnulli.us, hannes@stressinduktion.org, tom@herbertland.com, azhou@nicira.com, ebiederm@xmission.com, ipm@chirality.org.uk, nicolas.dichtel@6wind.com, serge.hallyn@canonical.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, anton@au1.ibm.com, nacc@linux.vnet.ibm.com, srikar@linux.vnet.ibm.com
X-Original-Date Fri, 28 Aug 2015 16:12:57 -0700
X-Original-Message-ID <1440803577.11525.182.camel@perches.com>
X-Original-References <1440610653-14210-3-git-send-email-raghavendra.kt@linux.vnet.ibm.com> <20150827.113823.214019265460582055.davem@davemloft.net> <55E00238.10909@linux.vnet.ibm.com> <20150828.112413.424099339331017970.davem@davemloft.net> <1440789654.11525.137.camel@perches.com> <1440794020.8932.45.camel@edumazet-glaptop2.roam.corp.google.com> <1440795211.11525.146.camel@perches.com> <1440795336.8932.46.camel@edumazet-glaptop2.roam.corp.google.com> <1440796183.11525.153.camel@perches.com> <1440796487.8932.48.camel@edumazet-glaptop2.roam.corp.google.com> <1440797172.11525.161.camel@perches.com> <1440800980.8932.66.camel@edumazet-glaptop2.roam.corp.google.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1215608

Show key headers only | View raw


On Fri, 2015-08-28 at 15:29 -0700, Eric Dumazet wrote:
> On Fri, 2015-08-28 at 14:26 -0700, Joe Perches wrote:
> 1) u64 array[XX] on stack is naturally aligned,

Of course it is.

> kzalloc() wont improve this at all. Not sure what you believe.

An alloc would only reduce stack use.

Copying into the buffer, then copying the buffer into the
skb may be desirable on some arches though.

> 2) put_unaligned() is basically a normal memory write on x86.
>  memcpy(dst,src,...) will have a problem anyway on arches that care,
> because src & dst wont have same alignment.

OK, so all the world's an x86?

On arm32, copying 288 bytes using nearly all aligned word
transfers is generally faster than using only unsigned
short transfers.

> 288 bytes on stack in a leaf function in this path is totally fine, it
> is not like we're calling ext4/xfs/nfs code after this point.

Generally true.  It's always difficult to know how much
stack has been consumed though and smaller stack frames
are generally better.

Anyway, the block copy from either the alloc'd or stack
buffer amounts only to a slight performance improvement
for arm32.  It doesn't really have much other utility.


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH RFC V2 0/2]  Optimize the snmp stat aggregation for large cpus  Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com> - 2015-08-26 19:50 +0200
  [PATCH RFC V2 2/2] net: Optimize snmp stat aggregation by walking all the percpu data at once Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com> - 2015-08-26 19:50 +0200
    Re: [PATCH RFC V2 2/2] net: Optimize snmp stat aggregation by  walking all the percpu data at once David Miller <davem@davemloft.net> - 2015-08-27 20:40 +0200
      Re: [PATCH RFC V2 2/2] net: Optimize snmp stat aggregation by walking  all the percpu data at once Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com> - 2015-08-28 08:40 +0200
        Re: [PATCH RFC V2 2/2] net: Optimize snmp stat aggregation by  walking all the percpu data at once David Miller <davem@davemloft.net> - 2015-08-28 20:30 +0200
          Re: [PATCH RFC V2 2/2] net: Optimize snmp stat aggregation by  walking all the percpu data at once Joe Perches <joe@perches.com> - 2015-08-28 21:30 +0200
            Re: [PATCH RFC V2 2/2] net: Optimize snmp stat aggregation by  walking all the percpu data at once Eric Dumazet <eric.dumazet@gmail.com> - 2015-08-28 22:40 +0200
              Re: [PATCH RFC V2 2/2] net: Optimize snmp stat aggregation by  walking all the percpu data at once Eric Dumazet <eric.dumazet@gmail.com> - 2015-08-28 23:00 +0200
                Re: [PATCH RFC V2 2/2] net: Optimize snmp stat aggregation by  walking all the percpu data at once Joe Perches <joe@perches.com> - 2015-08-28 23:10 +0200
                Re: [PATCH RFC V2 2/2] net: Optimize snmp stat aggregation by  walking all the percpu data at once Eric Dumazet <eric.dumazet@gmail.com> - 2015-08-28 23:20 +0200
                Re: [PATCH RFC V2 2/2] net: Optimize snmp stat aggregation by  walking all the percpu data at once Joe Perches <joe@perches.com> - 2015-08-28 23:30 +0200
                Re: [PATCH RFC V2 2/2] net: Optimize snmp stat aggregation by  walking all the percpu data at once Eric Dumazet <eric.dumazet@gmail.com> - 2015-08-29 00:30 +0200
                Re: [PATCH RFC V2 2/2] net: Optimize snmp stat aggregation by  walking all the percpu data at once Joe Perches <joe@perches.com> - 2015-08-29 01:20 +0200
                Re: [PATCH RFC V2 2/2] net: Optimize snmp stat aggregation by  walking all the percpu data at once Eric Dumazet <eric.dumazet@gmail.com> - 2015-08-29 02:10 +0200
                Re: [PATCH RFC V2 2/2] net: Optimize snmp stat aggregation by  walking all the percpu data at once Joe Perches <joe@perches.com> - 2015-08-29 02:40 +0200
                Re: [PATCH RFC V2 2/2] net: Optimize snmp stat aggregation by  walking all the percpu data at once Eric Dumazet <eric.dumazet@gmail.com> - 2015-08-29 03:10 +0200
              Re: [PATCH RFC V2 2/2] net: Optimize snmp stat aggregation by  walking all the percpu data at once Joe Perches <joe@perches.com> - 2015-08-28 23:00 +0200
          Re: [PATCH RFC V2 2/2] net: Optimize snmp stat aggregation by  walking all the percpu data at once Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com> - 2015-08-29 05:00 +0200
            Re: [PATCH RFC V2 2/2] net: Optimize snmp stat aggregation by  walking all the percpu data at once Eric Dumazet <eric.dumazet@gmail.com> - 2015-08-29 05:30 +0200
              Re: [PATCH RFC V2 2/2] net: Optimize snmp stat aggregation by walking  all the percpu data at once Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com> - 2015-08-29 10:00 +0200
            Re: [PATCH RFC V2 2/2] net: Optimize snmp stat aggregation by  walking all the percpu data at once David Miller <davem@davemloft.net> - 2015-08-29 07:20 +0200
              Re: [PATCH RFC V2 2/2] net: Optimize snmp stat aggregation by walking  all the percpu data at once Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com> - 2015-08-29 10:00 +0200

csiph-web