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 - 16:33:47 EST

On Fri, 2015-08-28 at 12:20 -0700, Joe Perches wrote:

> I don't read it as particularly different.
> There are > 100 uses of the not quite a memset initialization
> style using "= { <0,> }" in net/
> $ git grep -E "=\s*\{\s*0?\s*,?\s*\}" net | wc -l
> 138
> There is a difference though if a struct is copied to
> user-space as a {} initialization only guarantees that
> struct members are initialized to 0 where memset also
> zeros any alignment padding.

We do not bother for small struct.

Here, the array is big enough that David prefers having an explicit
memset() so that it clearly shows that author of this code was aware of

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