From: Ingo Molnar <mingo@elte.hu>
To: David Miller <davem@davemloft.net>,
Paul Mackerras <paulus@samba.org>,
Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: tglx@linutronix.de, mingo@redhat.com,
linux-kernel@vger.kernel.org, hpa@zytor.com
Subject: Re: x86's nmi_hz wrt. oprofile's nmi_timer_int.c
Date: Tue, 3 Feb 2009 13:27:32 +0100 [thread overview]
Message-ID: <20090203122732.GF19979@elte.hu> (raw)
In-Reply-To: <20090202.151439.124517945.davem@davemloft.net>
* David Miller <davem@davemloft.net> wrote:
> From: David Miller <davem@davemloft.net>
> Date: Fri, 30 Jan 2009 13:54:09 -0800 (PST)
>
> > From: Ingo Molnar <mingo@elte.hu>
> > Date: Fri, 30 Jan 2009 16:01:25 +0100
> >
> > >
> > > * David Miller <davem@davemloft.net> wrote:
> > >
> > > Reducing it to 1 HZ was kind of a performance hack: running NMIs at HZ
> > > needlessly interrupts the CPU HZ times a second. It's more than enough to
> > > have 1 nmi-watchdog tick per second to notice deadlocks that take longer
> > > than 5 seconds.
> >
> > For the NMI watchdog's purposes I understand the intent, and this
> > is perfectly fine.
> >
> > The problem is that it stays at '1' when oprofile starts using the NMI
> > watchdog, and we certainly want more than one oprofile tick per second
> > :-)
>
> Just making sure you understand the problem, here is the
> sequence of events:
>
> 1) At bootup, the NMI watchdog is tested.
>
> It is tested with nmi_hz=HZ
>
> 2) If the test passes, nmi_hz is reduced down to '1'
>
> As I stated, everything up to this point is fine. Next:
>
> 3) oprofile initializes and if we choose to use the NMI
> timer for oprofile profiling it is implemented using
> a simple DIE_NMI notifier.
>
> However, nmi_hz is still just '1' which means that oprofile
> will only receive one sample per-second. And this is definitely
> not what we want.
>
> Somehow the code in arch/x86/oprofile/nmi_timer_int.c needs to have an
> interface into the NMI watchdog core so that it can increase nmi_hz back
> up to "HZ" when the NMI timer profiling is enabled and back down to "1"
> when such profiling stops.
btw., these types of interactions will be solved in a natural way via
perfcounters: in that model the NMI watchdog is a set of per-CPU counters
running on each CPU [with a NMI watchdog callback in the IRQ handling
routine] - and oprofile uses its own perfcounter - what is left of the PMU
hardware.
I.e. each PMU using facility can just use performance counters transparently
and interactions will be solved naturally by perfcounters resource
management.
Ingo
next prev parent reply other threads:[~2009-02-03 12:28 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-29 23:58 x86's nmi_hz wrt. oprofile's nmi_timer_int.c David Miller
2009-01-30 15:01 ` Ingo Molnar
2009-01-30 21:54 ` David Miller
2009-02-02 23:14 ` David Miller
2009-02-03 12:27 ` Ingo Molnar [this message]
2009-02-22 17:06 ` Andi Kleen
2009-02-23 4:11 ` David Miller
2009-02-23 4:52 ` Andi Kleen
2009-02-23 5:59 ` David Miller
2009-02-23 6:34 ` Andi Kleen
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=20090203122732.GF19979@elte.hu \
--to=mingo@elte.hu \
--cc=a.p.zijlstra@chello.nl \
--cc=davem@davemloft.net \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=paulus@samba.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