public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andi Kleen <andi@firstfloor.org>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: Andi Kleen <andi@firstfloor.org>,
	eranian@googlemail.com, linux-kernel@vger.kernel.org,
	akpm@linux-foundation.org, mingo@elte.hu, x86@kernel.org,
	eranian@gmail.com, sfr@canb.auug.org.au
Subject: Re: [patch 05/24] perfmon: X86 generic code (x86)
Date: Thu, 27 Nov 2008 11:06:02 +0100	[thread overview]
Message-ID: <20081127100602.GF6703@one.firstfloor.org> (raw)
In-Reply-To: <alpine.LFD.2.00.0811262237140.3325@localhost.localdomain>

On Wed, Nov 26, 2008 at 11:54:30PM +0100, Thomas Gleixner wrote:
> On Wed, 26 Nov 2008, Andi Kleen wrote:
> > On Wed, Nov 26, 2008 at 02:35:18PM +0100, Thomas Gleixner wrote:
> > > > +	 */
> > > > +	pfm_arch_resend_irq(ctx);
> > > 
> > > Do we really need this whole NMI business ?
> > 
> > Without it you cannot profile interrupts off regions well.
> 
> Fair enough, but I doubt that this is a real solution.
> 
> There is not even an attempt to avoid the obvious wrmrsl races, while
> there are several comments which explain how expensive wrmrsl is. In
> the NMI handler we enable the NMI right away. This might cause
> multiple NMIs for nothing when the NMIs hit between the manipulations
> of the counters. Not likely but can happen depending on the counter
> settings.
> 
> Sending an self-IPI from NMI simply sucks: For every NMI we get an
> extra local interrupt and we have an extra of 2 * NR_ACTIVE_COUNTERS
> accesses to MSRs.

In newer Intel the counters can be reset/rearmed by accessing
only a few global control msrs. But it's probably still a problem 
on other PMUs.

On the other hand it also has PEBS which allows at least some 
profiling of irq-off regions without using NMIs.
> 
> Designing that code to use lockless buffers instead is not really
> rocket science.

Lockless buffers are nasty, but it works in oprofile at least.

Taking out NMis in the first version at least seems like a reasonable
solution. After all you can still use standard oprofile where they work
just fine.

-Andi

-- 
ak@linux.intel.com

  reply	other threads:[~2008-11-27  9:55 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-26  8:42 [patch 05/24] perfmon: X86 generic code (x86) eranian
2008-11-26 11:33 ` Andi Kleen
2008-11-26 12:05   ` Stephen Rothwell
2008-11-26 12:22     ` Andi Kleen
2008-11-26 12:48       ` Stephen Rothwell
2008-11-26 13:32     ` Thomas Gleixner
2008-11-26 13:56       ` stephane eranian
2008-11-26 16:38         ` Thomas Gleixner
2008-11-27  9:51           ` stephane eranian
2008-11-27 10:56             ` Thomas Gleixner
2008-11-27 11:37               ` David Miller
2008-11-27 14:40                 ` Thomas Gleixner
2008-11-26 13:35 ` Thomas Gleixner
2008-11-26 14:00   ` Andi Kleen
2008-11-26 21:18     ` Thomas Gleixner
2008-11-26 21:37       ` stephane eranian
2008-11-26 23:16         ` Thomas Gleixner
2008-11-27  9:38           ` stephane eranian
2008-11-26 22:54     ` Thomas Gleixner
2008-11-27 10:06       ` Andi Kleen [this message]
2008-11-27 10:09         ` stephane eranian
2008-11-27 10:29           ` Thomas Gleixner
2008-11-27 11:31           ` Andi Kleen
2008-11-27 11:35             ` stephane eranian
2008-11-27 11:42               ` David Miller
2008-11-27 11:49                 ` Thomas Gleixner
2008-11-27 12:38                   ` Andi Kleen
2008-11-27 12:31                     ` stephane eranian
2008-11-27 12:46                       ` Andi Kleen
2008-11-27 13:32                       ` Thomas Gleixner
2008-11-27 13:37                         ` stephane eranian
2008-11-27 13:51                           ` Andi Kleen
2008-11-27 13:50                         ` Andi Kleen
2008-11-27 11:52               ` Peter Zijlstra
2008-11-27 12:04                 ` stephane eranian
2008-11-27 12:16                   ` Peter Zijlstra
2008-11-27 12:32               ` Andi Kleen
2008-11-27 12:28                 ` stephane eranian
2008-11-27 12:45                   ` Andi Kleen
2008-11-27 13:30                     ` stephane eranian
2008-11-27 13:49                       ` Andi Kleen
2008-11-27 13:47                         ` stephane eranian
  -- strict thread matches above, loose matches on Subject: below --
2008-11-25 21:36 eranian

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=20081127100602.GF6703@one.firstfloor.org \
    --to=andi@firstfloor.org \
    --cc=akpm@linux-foundation.org \
    --cc=eranian@gmail.com \
    --cc=eranian@googlemail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=sfr@canb.auug.org.au \
    --cc=tglx@linutronix.de \
    --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