[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1440794020.8932.45.camel@edumazet-glaptop2.roam.corp.google.com>
Date: Fri, 28 Aug 2015 13:33:40 -0700
From: Eric Dumazet <eric.dumazet@...il.com>
To: Joe Perches <joe@...ches.com>
Cc: David Miller <davem@...emloft.net>,
raghavendra.kt@...ux.vnet.ibm.com, edumazet@...gle.com,
kuznet@....inr.ac.ru, jmorris@...ei.org, yoshfuji@...ux-ipv6.org,
kaber@...sh.net, jiri@...nulli.us, hannes@...essinduktion.org,
tom@...bertland.com, azhou@...ira.com, ebiederm@...ssion.com,
ipm@...rality.org.uk, nicolas.dichtel@...nd.com,
serge.hallyn@...onical.com, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, anton@....ibm.com,
nacc@...ux.vnet.ibm.com, srikar@...ux.vnet.ibm.com
Subject: Re: [PATCH RFC V2 2/2] net: Optimize snmp stat aggregation by
walking all the percpu data at once
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
this.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists