From: Ingo Molnar <mingo@kernel.org>
To: Andrey Ryabinin <aryabinin@virtuozzo.com>
Cc: akpm@linux-foundation.org, krinkin.m.u@gmail.com, mingo@elte.hu,
peterz@infradead.org, mm-commits@vger.kernel.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: Wed, 3 Feb 2016 10:49:36 +0100 [thread overview]
Message-ID: <20160203094936.GA17305@gmail.com> (raw)
In-Reply-To: <56B1CB7F.5070207@virtuozzo.com>
* Andrey Ryabinin <aryabinin@virtuozzo.com> wrote:
>
>
> On 02/03/2016 10:44 AM, Ingo Molnar wrote:
>
> > Yuck, I don't really like this.
> >
> > Lockdep initialization must happen early on, 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.
> >
> > Also, in addition to properly ordering UBSAN initialization, how about fixing the
> > silent crash by adding a lockdep warning to that place instead of an auto-init?
> >
> > The warning will turn lockdep off safely and will generate an actionable kernel
> > message and stackdump upon which the init ordering fix can be done.
> >
>
> Something like this already done for DEBUG_LOCKDEP=y (except it initializes lockdep instead of turning it off).
>
> look_up_lock_class():
> ...
> #ifdef CONFIG_DEBUG_LOCKDEP
> /*
> * If the architecture calls into lockdep before initializing
> * the hashes then we'll warn about it later. (we cannot printk
> * right now)
> */
> if (unlikely(!lockdep_initialized)) {
> lockdep_init();
> lockdep_init_error = 1;
> lock_init_error = lock->name;
> save_stack_trace(&lockdep_init_trace);
> }
> #endif
well, this is different, as we still generate an error - so it's not a 'permanent
solution' as the changelog says.
> Silent crash happens only in DEBUG_LOCKDEP=n && LOCKDEP=y combination.
> So, what about simply removing this #ifdef (and the other one in lockdep_info() )?
That's fine with me, as long as we also fix the init bug that triggers this code.
Thanks,
Ingo
next prev parent reply other threads:[~2016-02-03 9:49 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <56b11d2d.vVw1kB2la7Y+70xF%akpm@linux-foundation.org>
2016-02-03 7:44 ` + kernel-locking-lockdepc-make-lockdep-initialize-itself-on-demand.patch added to -mm tree Ingo Molnar
2016-02-03 9:42 ` Andrey Ryabinin
2016-02-03 9:49 ` Ingo Molnar [this message]
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
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=20160203094936.GA17305@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=mm-commits@vger.kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).