public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <a.p.zijlstra@chello.nl>
To: Paul Mackerras <paulus@samba.org>
Cc: Ingo Molnar <mingo@elte.hu>,
	linux-kernel@vger.kernel.org, Mike Galbraith <efault@gmx.de>,
	Arjan van de Ven <arjan@infradead.org>,
	Wu Fengguang <fengguang.wu@intel.com>,
	Eric Dumazet <dada1@cosmosbay.com>
Subject: Re: [PATCH 1/9] perf_counter: unify and fix delayed counter wakeup
Date: Sun, 29 Mar 2009 11:16:41 +0200	[thread overview]
Message-ID: <1238318201.23852.17.camel@twins> (raw)
In-Reply-To: <18894.48499.125187.92480@cargo.ozlabs.ibm.com>

On Sun, 2009-03-29 at 11:14 +1100, Paul Mackerras wrote:
> Peter Zijlstra writes:
> 
> > While going over the wakeup code I noticed delayed wakeups only work
> > for hardware counters but basically all software counters rely on
> > them.
> 
> Hmmm, I don't like the extra latency this introduces, particularly
> since on powerpc we already have a good way to avoid the latency.

Right, so I can re-instate the powerpc bits and have it call
perf_counter_do_pending() whenever it finds the per-cpu pending bit set.

I'd have to look into the fancy new per-cpu stuff for the x86 bits, but
I'm reasonably sure something like that should be doable.

> I did a grep for perf_swcounter_event calls that have nmi=1, and there
> are a couple, to my surprise.  Why does the context switch one have
> nmi=1?  It certainly isn't called from an actual NMI handler.  Is it
> because of locking issues?

Yeah, can't do a wakeup while holding the rq->lock.

> The other one is the tracepoint call in perf_tpcounter_event.  I
> assume you have put nmi=1 there because you don't know what context
> we're in.  That means we'll always delay the wakeup even when we might
> be in an ordinary interrupt-on process context.  Couldn't we do
> better?

Maybe, not only real in_nmi() tracepoints have that problem, we also
have lock_acquire() like tracepoints that could call into the event code
in the middle of a lock acquisition (which might be rq->lock).

So always using nmi=1 for those seemed like the safe way out.


  reply	other threads:[~2009-03-29  9:16 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-28 19:43 [PATCH 0/9] perf_counter patches Peter Zijlstra
2009-03-28 19:44 ` [PATCH 1/9] perf_counter: unify and fix delayed counter wakeup Peter Zijlstra
2009-03-29  0:14   ` Paul Mackerras
2009-03-29  9:16     ` Peter Zijlstra [this message]
2009-03-29  9:25       ` Peter Zijlstra
2009-03-29 10:02         ` Paul Mackerras
2009-03-28 19:44 ` [PATCH 2/9] perf_counter: fix update_userpage() Peter Zijlstra
2009-03-29  0:24   ` Paul Mackerras
2009-04-02  8:50     ` Peter Zijlstra
2009-04-02  9:00       ` Peter Zijlstra
2009-04-02  9:21         ` Paul Mackerras
2009-04-02  9:28           ` Peter Zijlstra
2009-04-02  9:15       ` Paul Mackerras
2009-04-02  9:36         ` Peter Zijlstra
2009-04-02  9:58           ` Paul Mackerras
2009-04-02 10:36             ` Peter Zijlstra
2009-03-28 19:44 ` [PATCH 3/9] perf_counter: kerneltop: simplify data_head read Peter Zijlstra
2009-03-28 19:44 ` [PATCH 4/9] perf_counter: executable mmap() information Peter Zijlstra
2009-03-28 19:44 ` [PATCH 5/9] perf_counter: kerneltop: parse the mmap data stream Peter Zijlstra
2009-03-28 19:44 ` [PATCH 6/9] perf_counter: powerpc: only reserve PMU hardware when we need it Peter Zijlstra
2009-03-28 19:44 ` [PATCH 7/9] perf_counter: make it possible for hw_perf_counter_init to return error codes Peter Zijlstra
2009-03-30  4:13   ` Paul Mackerras
2009-03-28 19:44 ` [PATCH 8/9] perf_counter tools: optionally scale counter values in perfstat mode Peter Zijlstra
2009-03-28 19:44 ` [PATCH 9/9] RFC perf_counter: event overlow handling 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=1238318201.23852.17.camel@twins \
    --to=a.p.zijlstra@chello.nl \
    --cc=arjan@infradead.org \
    --cc=dada1@cosmosbay.com \
    --cc=efault@gmx.de \
    --cc=fengguang.wu@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=paulus@samba.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