public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Dave Hansen <dave.hansen@linux.intel.com>
Cc: mingo@kernel.org, hpa@zytor.com, linux-kernel@vger.kernel.org,
	tglx@linutronix.de, dzickus@redhat.com,
	linux-tip-commits@vger.kernel.org
Subject: Re: [tip:perf/core] x86/nmi: Push duration printk() to irq context
Date: Mon, 10 Feb 2014 18:05:26 +0100	[thread overview]
Message-ID: <20140210170526.GP9987@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <52F9021C.1030801@linux.intel.com>

On Mon, Feb 10, 2014 at 08:45:16AM -0800, Dave Hansen wrote:
> On 02/10/2014 05:29 AM, tip-bot for Peter Zijlstra wrote:
> > x86/nmi: Push duration printk() to irq context
> > 
> > Calling printk() from NMI context is bad (TM), so move it to IRQ
> > context.
> 
> Bad since the I/O device that we're doing it to may be slow and make the
> NMI painfully long?
> 
> I can see why it might be a bad idea, but I'm unsold that it is
> *universally* a bad idea.

printk() takes locks, NMI interrupts printk lock and tries to printk.
you get to keep pieces.



> > In doing so we slightly change (probably wreck) the debugfs
> > nmi_longest_ns thingy, in that it doesn't update to reflect the
> > longest, nor does writing to it reset the count.
> 
> The reason I coded this up was that NMIs were firing off so fast that
> nothing else was getting a chance to run.  With this patch, at least the
> printk() would come out and I'd have some idea what was going on.

Ah indeed, in which case you don't get to run the irq_work. But you
really shouldn't do printk() from NMI and esp. not in a case that
regularly and reliably triggers for everyone and is not a hardware
error.

  reply	other threads:[~2014-02-10 17:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-10 13:29 [tip:perf/core] x86/nmi: Push duration printk() to irq context tip-bot for Peter Zijlstra
2014-02-10 16:45 ` Dave Hansen
2014-02-10 17:05   ` Peter Zijlstra [this message]
2014-02-11 15:01   ` Peter Zijlstra
2014-02-11 16:44     ` Dave Hansen
2014-02-21 21:12     ` [tip:perf/core] perf/x86: Warn to early_printk() in case irq_work is too slow tip-bot for 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=20140210170526.GP9987@twins.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=dave.hansen@linux.intel.com \
    --cc=dzickus@redhat.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.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