From: Andrey Ryabinin <aryabinin@virtuozzo.com>
To: Ingo Molnar <mingo@kernel.org>, <akpm@linux-foundation.org>
Cc: <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 12:42:23 +0300 [thread overview]
Message-ID: <56B1CB7F.5070207@virtuozzo.com> (raw)
In-Reply-To: <20160203074430.GA32652@gmail.com>
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
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() )?
I
next prev parent reply other threads:[~2016-02-03 9:41 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 [this message]
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
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=56B1CB7F.5070207@virtuozzo.com \
--to=aryabinin@virtuozzo.com \
--cc=a.p.zijlstra@chello.nl \
--cc=akpm@linux-foundation.org \
--cc=krinkin.m.u@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=mingo@kernel.org \
--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 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.