All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: aryabinin@virtuozzo.com, krinkin.m.u@gmail.com, mingo@elte.hu,
	peterz@infradead.org, linux-kernel@vger.kernel.org,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: + kernel-locking-lockdepc-make-lockdep-initialize-itself-on-demand.patch added to -mm tree
Date: Tue, 9 Feb 2016 12:12:29 +0100	[thread overview]
Message-ID: <20160209111228.GA32615@gmail.com> (raw)
In-Reply-To: <20160203085111.fc3f2631.akpm@linux-foundation.org>


* Andrew Morton <akpm@linux-foundation.org> wrote:

> > and it should happen in a well defined place, not be opportunistic (and 
> > relatively random) like this, making it dependent on config options and 
> > calling contexts.
> 
> That's an unusable assertion, sorry.
> 
> Initializing lockdep in the above manner guarantees that it is initialized 
> before it is used.  It is *much* more reliable than "try to initialize it before 
> some piece of code which hasn't even been written yet tries to take a lock".

So I didn't like that patch because it called into lockdep in a messy way, without 
having any real knowledge about whether it's safe to do. Should lockdep ever grow 
more complex initialization, such a solution could break in subtle ways. I prefer 
clearly broken code with static dependencies over context-dependent broken code 
with dynamic call ordering/dependencies.

Fortunately we don't have to apply the patch:

> The conceptual problem is that if some piece of code does spin_lock_init() or 
> DEFINE_SPINLOCK(), that lock isn't necessarily initialized yet.

The conceptual problem is that the data structures are not build time initialized 
- but the hlist conversion patch solves that problem nicely!

So I'm a happy camper.

Thanks,

	Ingo

  parent reply	other threads:[~2016-02-09 11:12 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-02 21:18 + kernel-locking-lockdepc-make-lockdep-initialize-itself-on-demand.patch added to -mm tree akpm
2016-02-03  7:44 ` Ingo Molnar
2016-02-03  9:42   ` Andrey Ryabinin
2016-02-03  9:49     ` Ingo Molnar
2016-02-03 16:51   ` Andrew Morton
2016-02-03 20:40     ` Andrew Morton
2016-02-03 21:44       ` Andrew Morton
2016-02-04 13:13         ` Andrey Ryabinin
2016-02-08  9:33           ` Michael Ellerman
2016-02-09 11:00           ` Ingo Molnar
2016-02-09 11:12     ` Ingo Molnar [this message]
2016-02-09 20:17       ` Andrew Morton
2016-02-29  9:11         ` Ingo Molnar
2016-02-29  9:25           ` Ingo Molnar
2016-02-29  9:30             ` Andrey Ryabinin

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=20160209111228.GA32615@gmail.com \
    --to=mingo@kernel.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=akpm@linux-foundation.org \
    --cc=aryabinin@virtuozzo.com \
    --cc=krinkin.m.u@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.