mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: "Lendacky, Thomas" <Thomas.Lendacky@amd.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"x86@kernel.org" <x86@kernel.org>, Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Namhyung Kim <namhyung@kernel.org>, Jiri Olsa <jolsa@redhat.com>,
	Jerry Hoemann <jerry.hoemann@hpe.com>
Subject: Re: [PATCH] perf/x86/amd: Change NMI latency mitigation to use a timestamp
Date: Thu, 1 Aug 2019 23:34:23 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.21.1908012331550.1789@nanos.tec.linutronix.de> (raw)
In-Reply-To: <b4597324-6eb8-31fa-e911-63f3b704c974@amd.com>

On Thu, 1 Aug 2019, Lendacky, Thomas wrote:
> On 8/1/19 4:16 PM, Peter Zijlstra wrote:
> > On Thu, Aug 01, 2019 at 06:57:41PM +0000, Lendacky, Thomas wrote:
> >> From: Tom Lendacky <thomas.lendacky@amd.com>
> >>
> >> It turns out that the NMI latency workaround from commit 6d3edaae16c6
> >> ("x86/perf/amd: Resolve NMI latency issues for active PMCs") ends up
> >> being too conservative and results in the perf NMI handler claiming NMIs
> >> to easily on AMD hardware when the NMI watchdog is active.
> >>
> >> This has an impact, for example, on the hpwdt (HPE watchdog timer) module.
> >> This module can produce an NMI that is used to reset the system. It
> >> registers an NMI handler for the NMI_UNKNOWN type and relies on the fact
> >> that nothing has claimed an NMI so that its handler will be invoked when
> >> the watchdog device produces an NMI. After the referenced commit, the
> >> hpwdt module is unable to process its generated NMI if the NMI watchdog is
> >> active, because the current NMI latency mitigation results in the NMI
> >> being claimed by the perf NMI handler.
> >>
> >> Update the AMD perf NMI latency mitigation workaround to, instead, use a
> >> window of time. Whenever a PMC is handled in the perf NMI handler, set a
> >> timestamp which will act as a perf NMI window. Any NMIs arriving within
> >> that window will be claimed by perf. Anything outside that window will
> >> not be claimed by perf. The value for the NMI window is set to 100 msecs.
> >> This is a conservative value that easily covers any NMI latency in the
> >> hardware. While this still results in a window in which the hpwdt module
> >> will not receive its NMI, the window is now much, much smaller.
> > 
> > Blergh, I so hate all this. The proposed patch is basically duct tape.
> 
> Yeah, I'm not a fan either.
> 
> > 
> > The horribly retarded x86 NMI infrastructure strikes again :/
> > 
> > Tom; do you have any idea how expensive it is to twiddle CR8 and play
> > games with interrupt priorities instead of piling world + dog on this
> > one NMI line? (as compared to CLI/STI)
> 
> I can check on that.  What are you thinking?

Avoid the whole NMI mess, make the PMC interrupt a proper vector in the
highest prio bucket and instead of using CLI/STI use CR8. That would have
the additional advantage that we could prevent perf "NMI" then occsionally :)

Thanks,

	tglx

  reply	other threads:[~2019-08-01 21:34 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-01 18:57 Lendacky, Thomas
2019-08-01 21:16 ` Peter Zijlstra
2019-08-01 21:29   ` Lendacky, Thomas
2019-08-01 21:34     ` Thomas Gleixner [this message]
2019-08-01 21:48       ` Peter Zijlstra
2019-08-01 21:59         ` Thomas Gleixner
2019-08-02 14:33           ` Lendacky, Thomas
2019-08-02 16:20             ` Peter Zijlstra
2019-08-02 16:33               ` Peter Zijlstra
2019-08-08 20:33                 ` Jerry Hoemann
2019-09-13 19:52                   ` Jerry Hoemann

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=alpine.DEB.2.21.1908012331550.1789@nanos.tec.linutronix.de \
    --to=tglx@linutronix.de \
    --cc=Thomas.Lendacky@amd.com \
    --cc=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=bp@alien8.de \
    --cc=jerry.hoemann@hpe.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=x86@kernel.org \
    /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®