From: Peter Zijlstra <peterz@infradead.org>
To: David Rientjes <rientjes@google.com>
Cc: Ingo Molnar <mingo@elte.hu>,
"David S. Miller" <davem@davemloft.net>,
linux-kernel@vger.kernel.org
Subject: Re: [patch 2/2] lockdep: initialize lockdep debugging statistics
Date: Fri, 06 Mar 2009 11:19:16 +0100 [thread overview]
Message-ID: <1236334756.6326.106.camel@laptop> (raw)
In-Reply-To: <alpine.DEB.2.00.0903060149540.26215@chino.kir.corp.google.com>
On Fri, 2009-03-06 at 01:56 -0800, David Rientjes wrote:
>
> Peter, this is purely a matter of good software engineering practices.
For complex types I would agree, but atomic_t is assumed to be just
another int - just with special ops. For such things we can hold that
memset('0') will properly initialize them to their 0 value.
> I
> hadn't realized you were so passionate about avoiding initialization of
> global atomic_t variables,
Given that static/global storage is properly initialized to 0, and the
above, it seems to be redundant.
> I assume you wouldn't object to removing all such cases in the kernel.
>
> $ grep -r "atomic_t.*= ATOMIC_INIT(0)" * | wc -l
> 104
Only IFF all those cases are for static/global storage. Otherwise you
have to ensure 0-ness by either using __GFP_ZERO or explicit
initialization.
next prev parent reply other threads:[~2009-03-06 10:19 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-05 10:29 [patch 1/2] lockdep: remove duplicate CONFIG_DEBUG_LOCKDEP definitions David Rientjes
2009-03-05 10:29 ` [patch 2/2] lockdep: initialize lockdep debugging statistics David Rientjes
2009-03-05 10:48 ` [tip:core/locking] " David Rientjes
2009-03-05 10:49 ` [patch 2/2] " Peter Zijlstra
2009-03-05 11:05 ` Ingo Molnar
2009-03-05 21:57 ` David Rientjes
2009-03-06 8:28 ` Peter Zijlstra
2009-03-06 9:56 ` David Rientjes
2009-03-06 10:19 ` Peter Zijlstra [this message]
2009-03-06 10:27 ` David Rientjes
2009-03-06 10:46 ` Peter Zijlstra
2009-03-06 10:05 ` Li Zefan
2009-03-05 10:48 ` [tip:core/locking] lockdep: remove duplicate CONFIG_DEBUG_LOCKDEP definitions David Rientjes
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1236334756.6326.106.camel@laptop \
--to=peterz@infradead.org \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=rientjes@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox