Re: [patch 2/2] lockdep: initialize lockdep debugging statistics

From: Li Zefan
Date: Fri Mar 06 2009 - 05:06:13 EST


Peter Zijlstra wrote:
> On Thu, 2009-03-05 at 13:57 -0800, David Rientjes wrote:
>> It shouldn't be dropped, the initialization is necessary because we can't
>> rely on atomic_t's implementation.
>
> I'm a bit slow, please use more words and explain this to me.
>

I once was also (and is still not sure) wondering if it's better to use
INIT_HLIST_HEAD() for initialization for the reason David is claiming..

The situation is similar with this ATOMIC_INIT(), that INIT_HLIST_HEAD()
just set 2 pointers to 0, and not every user of hlist calls this INIT()
at initialization phase.

But I'll definitely on David's side if it's not kernel project.

> Before replying please read:
>
> ea435467500612636f8f4fb639ff6e76b2496e4b
>
> and stare at the output of:
>
> git grep "define[ \t]*ATOMIC_INIT\>"
>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/