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

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 2015-08-29 01:20 +0200
Message-ID <q2B6a-Rf-11@gated-at.bofh.it> (permalink)
References (7 earlier) <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>
Organization linux.* mail to news gateway

Show all headers | 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