All of lore.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>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] perf_counter: allow and require one-page mmap on counting counters
Date: Wed, 01 Apr 2009 10:13:42 +0200	[thread overview]
Message-ID: <1238573622.8530.2582.camel@twins> (raw)
In-Reply-To: <18898.53849.913178.781844@drongo.ozlabs.ibm.com>

On Wed, 2009-04-01 at 13:32 +1100, Paul Mackerras wrote:
> Peter Zijlstra writes:
> 
> > On Wed, 2009-03-25 at 20:42 +1100, Paul Mackerras wrote:
> > > 
> > > And here's something else that is semi-related: the PAPI guys want a
> > > kind of counter that counts until it overflows, and then sends a
> > > signal to the process and disables itself (and the whole group it's
> > > in).
> > 
> > I tried doing this this evening, and its remarkably hard. Disabling a
> > counter relies on reading the time, and taking ctx->lock and such.
> > Things that are impossible to do in NMI context.
> 
> So, if I have a group where the leader is a hardware counter set to
> use NMIs, and there is a task_clock software counter in the group,
> don't we hit exactly the same issue with reading the time?

Hmm, I think you're right there. Nasty.

> I'd be OK with saying that you can't use stop-and-signal with NMI
> counters.

Right, so let them use regular IRQs, yes, that will work. Let me code
that.

>   There will still be some issues on powerpc because of our
> lazy interrupt disabling scheme, so some work might have to get
> deferred until we soft-enable interrupts, but we have a way to manage
> that.

Hmm, you're saying ppc always uses NMIs, even when !hw_event.nmi?

> On another topic, I noticed that we have a race with perf_counter_read
> where we do the IPI but don't check in __read() on the destination cpu
> that the task we're after is still running on that cpu.  It needs
> checking and retry logic like we have in other places in
> perf_counter.c.

Yep, you're right again. Should we perhaps generalize that whole code
and provide a method vector for the various bits. That way we could
collapse all that code replication.

This TODO list keeps growing :-)

BTW, how's progress with the lazy switching?


  reply	other threads:[~2009-04-01  8:13 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-25  8:15 [PATCH] perf_counter: allow and require one-page mmap on counting counters Paul Mackerras
2009-03-25  8:28 ` Ingo Molnar
2009-03-25  8:34   ` Peter Zijlstra
2009-03-25  8:56   ` Paul Mackerras
2009-03-25  9:03     ` Ingo Molnar
2009-03-25  9:14       ` Peter Zijlstra
2009-03-25  9:42       ` Paul Mackerras
2009-03-31 19:15         ` Peter Zijlstra
2009-04-01  2:32           ` Paul Mackerras
2009-04-01  8:13             ` Peter Zijlstra [this message]
2009-04-01  9:31               ` Paul Mackerras
2009-03-25 11:48 ` Peter Zijlstra
2009-03-25 11:52   ` Ingo Molnar
2009-03-25 12:07   ` [tip:perfcounters/core] " 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=1238573622.8530.2582.camel@twins \
    --to=a.p.zijlstra@chello.nl \
    --cc=akpm@linux-foundation.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.