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

From: Eric Dumazet
Date: Fri Aug 28 2015 - 18:29:47 EST

On Fri, 2015-08-28 at 14:26 -0700, Joe Perches wrote:

> Always a possibility, but I don't think so.
> > put_unaligned is happening on a space allocated from rtnetlink skb, not
> > the temp space needed to perform the per cpu folding.
> That's why I suggested changing the snmp_fill_stats arguments.
> If the naturally aligned allocated u64 array is used and then
> copied as a block to the rtnetlink skb, I believe there's no
> alignment issue that would require put_unaligned.

1) u64 array[XX] on stack is naturally aligned,
kzalloc() wont improve this at all. Not sure what you believe.

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.

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.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at