From: Stephane Eranian <eranian@hpl.hp.com>
To: Chuck Ebbert <76306.1226@compuserve.com>
Cc: Andi Kleen <ak@suse.de>, linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 10/17] 2.6.17.1 perfmon2 patch for review: PMU context switch
Date: Fri, 30 Jun 2006 11:43:03 -0700 [thread overview]
Message-ID: <20060630184303.GA22835@frankl.hpl.hp.com> (raw)
In-Reply-To: <200606301435_MC3-1-C3DD-5B3E@compuserve.com>
Chuck,
On Fri, Jun 30, 2006 at 02:33:49PM -0400, Chuck Ebbert wrote:
> In-Reply-To: <200606301541.22928.ak@suse.de>
>
> On Fri, 30 Jun 2006 15:41:22 +0200, Andi Kleen wrote:
>
> > > So why do we need care about context switch in cpu-wide mode?
> > > It is because we support a mode where the idle thread is excluded
> > > from cpu-wide monitoring. This is very useful to distinguish
> > > 'useful kernel work' from 'idle'.
> >
> > I don't quite see the point because on x86 the PMU doesn't run
> > during C states anyways. So you get idle excluded automatically.
>
> Looks like it does run:
>
> $ pfmon -ecpu_clk_unhalted,interrupts_masked_cycles -k --system-wide -t 10
> <session to end in 10 seconds>
> CPU0 60351837 CPU_CLK_UNHALTED
> CPU0 346548229 INTERRUPTS_MASKED_CYCLES
>
> The CPU spent ~60 million clocks unhalted and ~350 million with interrupts
> disabled. (This is an idle 1.6GHz Turion64 machine.)
>
I think it stops counting only CERTAIN events. That's where it becomes difficult
to interpret. There was a defect like this on Itanium 2.
> Now let's see what happens when we exclude the idle thread:
>
> $ pfmon -ecpu_clk_unhalted,interrupts_masked_cycles -k --system-wide -t 10 --excl-idle
> <session to end in 10 seconds>
> CPU0 449250 CPU_CLK_UNHALTED
> CPU0 161577 INTERRUPTS_MASKED_CYCLES
>
> Looks like excluding the idle thread means interrupts that happen while idle
> don't get counted either. We took 5000 clock interrupts and I know they take
> longer than that to process.
>
Yes, the way it is implemented today means that nothing happening while the idle
threads runs/sleeps is counted. Monitoring is disabled at context switch boundaries
for task->pid==0.
I would rather have something that would stop counting *EVERYTHING* ONLY when
going low-power OR when busy looping. That's why the idle notififers that Andi mentioned
are interesting. But this would not cover interrupts received while in idle and yet we
want to measure those as they represent useful kernel work. This is unless interrupts while
idle qualifies for an exit_idle() notification.
--
-Stephane
next prev parent reply other threads:[~2006-06-30 18:51 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-30 18:33 [PATCH 10/17] 2.6.17.1 perfmon2 patch for review: PMU context switch Chuck Ebbert
2006-06-30 18:42 ` Andi Kleen
2006-06-30 18:43 ` Stephane Eranian [this message]
2006-06-30 20:40 ` Stephane Eranian
-- strict thread matches above, loose matches on Subject: below --
2006-07-06 17:30 Chuck Ebbert
2006-07-06 20:16 ` Stephane Eranian
2006-07-01 15:21 Chuck Ebbert
2006-07-04 15:28 ` Stephane Eranian
2006-06-30 19:17 Chuck Ebbert
2006-06-30 19:37 ` Andi Kleen
2006-06-23 9:13 Stephane Eranian
2006-06-30 12:27 ` Andi Kleen
2006-06-30 12:36 ` Stephane Eranian
2006-06-30 12:59 ` Andi Kleen
2006-06-30 13:29 ` Stephane Eranian
2006-06-30 13:41 ` Andi Kleen
2006-06-30 14:12 ` Stephane Eranian
2006-06-30 14:33 ` Andi Kleen
2006-06-30 16:02 ` Stephane Eranian
2006-06-30 17:08 ` Andi Kleen
2006-06-30 20:47 ` Stephane Eranian
2006-07-03 9:49 ` Stephane Eranian
2006-07-03 19:25 ` Andi Kleen
2006-07-03 19:22 ` Stephane Eranian
2006-07-03 19:36 ` Andi Kleen
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=20060630184303.GA22835@frankl.hpl.hp.com \
--to=eranian@hpl.hp.com \
--cc=76306.1226@compuserve.com \
--cc=ak@suse.de \
--cc=linux-kernel@vger.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