mirror of https://lore.kernel.org/lkml/
 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,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH] perfcounters: Make s/w counters in a group only count when group is on
Date: Fri, 13 Mar 2009 11:23:36 +0100	[thread overview]
Message-ID: <1236939816.22914.3714.camel@twins> (raw)
In-Reply-To: <18873.48668.562126.113618@cargo.ozlabs.ibm.com>

On Fri, 2009-03-13 at 12:59 +1100, Paul Mackerras wrote:
> Impact: bug fix
> 
> If one has a group that has one or more hardware counters in it and also
> a software counter, the software counter should count only when the
> hardware counters are on the PMU.  At present, the software counters
> count all the time, even when the hardware counters can't go on the PMU.
> 
> Fundamentally, the problem is that currently we are using sched-out for
> two distinct things: one is "take the counters off because this task
> is being taken off the CPU" and the other is "take the counters off
> because this group can't go on, or because we're changing things around".

> In the first case we need the software counters to keep counting, and in
> the second case we need them to stop, but currently we use sched_out
> functions for both.

I'm not getting it.

The latter case first -- we seem to agree on that:

In group_sched_in() we first call hw_perf_group_sched_in(), which can
validate if the group is at all schedulable.

Then we simply iterate the group counter list and add each counter, if
one, for whatever reason, fails, we simply remove all counters of that
group we scheduled in.

So we either schedule a full group or non of them.


The former case however, you seem to say we should keep software
counters active even though their associated task is scheduled out? That
doesn't appear to make sense to me.

Why would you want to do that?



  reply	other threads:[~2009-03-13 10:24 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-13  1:59 Paul Mackerras
2009-03-13 10:23 ` Peter Zijlstra [this message]
2009-03-13 12:23   ` Paul Mackerras
2009-03-13 12:44     ` Peter Zijlstra
2009-03-13 13:04       ` Peter Zijlstra
2009-03-13 13:13         ` Ingo Molnar
2009-03-13 23:43           ` Paul Mackerras
2009-03-13 22:41       ` Paul Mackerras
2009-03-14 11:51         ` Ingo Molnar
2009-03-16  9:56         ` Peter Zijlstra
2009-03-16 10:33           ` Paul Mackerras

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=1236939816.22914.3714.camel@twins \
    --to=a.p.zijlstra@chello.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --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

Powered by JetHome