public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Don Zickus <dzickus@redhat.com>
To: Stephane Eranian <eranian@google.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	mingo@elte.hu, Paul Mackerras <paulus@samba.org>,
	Robert Richter <robert.richter@amd.com>
Subject: Re: [PATCH 0/3 v2] new nmi_watchdog using perf events
Date: Fri, 12 Feb 2010 11:59:20 -0500	[thread overview]
Message-ID: <20100212165920.GB3062@redhat.com> (raw)
In-Reply-To: <bd4cb8901002120812n7da16b6k29dd9b950ac68f25@mail.gmail.com>

On Fri, Feb 12, 2010 at 05:12:38PM +0100, Stephane Eranian wrote:
> Don,
> 
> How is this new NMI watchdog code going to work when you also have OProfile
> enabled in your kernel?
> 
> Today, perf_event disables the NMI watchdog while there is at least one event.
> By releasing the PMU registers, it also allows for Oprofile to work.
> 
> But now with this new NMI watchdog code, perf_event never releases the PMU.
> Thus, I suspect Oprofile will not work anymore, unless the NMI watchdog is
> explicitly disabled. Up until now OProfile could co-exist with the NMI watchdog.

You are right.  Originally when I read the code I thought perf_event just
grabbed all the PMUs in reserve_pmc_init().  But I see that only happens
when someone actually creates a PERF_TYPE_HARDWARE event, which the new
nmi watchdog does.  Those PMUs only get released when the event is
destroyed which my new code only does when the cpu disappears.

So yeah, I have effectively blocked oprofile from working.  I can change
my code such that when you disable the nmi_watchdog, you can release the
PMUs and let oprofile work.

But then I am curious, considering that perf and oprofile do the same
thing, how much longer do we let competing subsystems control the same
hardware?  I thought the point of the perf_event subsystem was to have a
proper framework on top of the PMUs such that anyone who wants to use it
just registers themselves, which is what the new nmi_watchdog is doing.

I can add code that allows oprofile and the new nmi watchdog to coexist,
but things get a little ugly to maintain.  Just wondering what the
gameplan is here?

Cheers,
Don


  reply	other threads:[~2010-02-12 17:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-12 16:12 [PATCH 0/3 v2] new nmi_watchdog using perf events Stephane Eranian
2010-02-12 16:59 ` Don Zickus [this message]
2010-02-12 17:12   ` Stephane Eranian
2010-02-14  8:31     ` Ingo Molnar
2010-02-15 20:04     ` Robert Richter
  -- strict thread matches above, loose matches on Subject: below --
2010-02-06  2:47 Don Zickus

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=20100212165920.GB3062@redhat.com \
    --to=dzickus@redhat.com \
    --cc=eranian@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=paulus@samba.org \
    --cc=peterz@infradead.org \
    --cc=robert.richter@amd.com \
    /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