mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Petr Mladek <pmladek@suse.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Ingo Molnar <mingo@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
	"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Subject: Re: [PATCH] printk/tracing: Do not trace printk_nmi_enter()
Date: Fri, 7 Sep 2018 10:28:34 +0200	[thread overview]
Message-ID: <20180907082834.vjycyvt6nddpb4la@pathway.suse.cz> (raw)
In-Reply-To: <20180907074531.GM24106@hirez.programming.kicks-ass.net>

On Fri 2018-09-07 09:45:31, Peter Zijlstra wrote:
> On Thu, Sep 06, 2018 at 11:31:51AM +0900, Sergey Senozhatsky wrote:
> > An alternative option, thus, could be re-instating back the rule that
> > lockdep_off/on should be the first and the last thing we do in
> > nmi_enter/nmi_exit. E.g.
> > 
> > nmi_enter()
> > 	lockdep_off();
> > 	printk_nmi_enter();
> > 
> > nmi_exit()
> > 	printk_nmi_exit();
> > 	lockdep_on();
> 
> Yes that. Also, those should probably be inline functions.
> 
> ---
> Subject: locking/lockdep: Fix NMI handling
> 
> Someone put code in the NMI handler before lockdep_off(). Since lockdep
> is not NMI safe, this wrecks stuff.

My view is that nmi_enter() has to switch several features into
NMI-safe mode. The code must not trigger the other features when
they are still in the unsafe mode.

It is a chicken&egg problem. And it is hard to completely prevent
regressions caused by future changes.

I though that printk_nmi_enter() should never need any lockdep-related
code. On the other hand, people might want to printk debug messages
when lockdep_off() is called. This is why I put it in the current order.

That said, I am not against this change. Especially the inlining
is a good move. Note that lockdep_off()/lockdep_on() must not
be traced as well.

Best Regards,
Petr

  reply	other threads:[~2018-09-07  8:28 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-06  1:33 Steven Rostedt
2018-09-06  2:31 ` Sergey Senozhatsky
2018-09-06  9:04   ` Petr Mladek
2018-09-06 15:22   ` Steven Rostedt
2018-09-07  7:45   ` Peter Zijlstra
2018-09-07  8:28     ` Petr Mladek [this message]
2018-09-07  8:35       ` Sergey Senozhatsky
2018-09-07 13:47         ` Steven Rostedt
2018-09-07  9:30       ` Peter Zijlstra
2018-09-07 13:53         ` Steven Rostedt
2018-09-10  5:32     ` locking/lockdep: Fix NMI handling kbuild test robot
2018-09-07  7:34 ` [PATCH] printk/tracing: Do not trace printk_nmi_enter() Peter Zijlstra
2018-09-07 13:41   ` Steven Rostedt
2018-09-07 13:45     ` Peter Zijlstra
2018-09-07 13:55       ` Steven Rostedt
2018-09-07 14:01         ` Steven Rostedt
2018-09-07 14:03           ` Peter Zijlstra
2018-09-07 14:52             ` Sergey Senozhatsky
2018-09-07 14:02         ` Peter Zijlstra

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=20180907082834.vjycyvt6nddpb4la@pathway.suse.cz \
    --to=pmladek@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=sergey.senozhatsky.work@gmail.com \
    --cc=sergey.senozhatsky@gmail.com \
    --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

all inboxes | Powered by JetHome®