linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Corey Ashford <cjashfor@linux.vnet.ibm.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: paulus <paulus@samba.org>,
	stephane eranian <eranian@googlemail.com>,
	Robert Richter <robert.richter@amd.com>,
	Will Deacon <will.deacon@arm.com>,
	Paul Mundt <lethal@linux-sh.org>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Cyrill Gorcunov <gorcunov@gmail.com>,
	Lin Ming <ming.m.lin@intel.com>,
	Yanmin <yanmin_zhang@linux.intel.com>,
	Deng-Cheng Zhu <dengcheng.zhu@gmail.com>,
	David Miller <davem@davemloft.net>,
	linux-kernel@vger.kernel.org
Subject: Re: [RFC][PATCH 00/11] perf pmu interface -v2
Date: Wed, 30 Jun 2010 10:19:27 -0700	[thread overview]
Message-ID: <4C2B7C9F.5070100@linux.vnet.ibm.com> (raw)
In-Reply-To: <1277738009.3561.129.camel@laptop>

On 06/28/2010 08:13 AM, Peter Zijlstra wrote:
> On Sat, 2010-06-26 at 09:22 -0700, Corey Ashford wrote:
> As for the "hardware write batching", can you describe a bit more about
>> what you have in mind there?  I wonder if this might have something to
>> do with accounting for PMU hardware which is slow to access, for
>> example, via I2C via an internal bridge.
>
> Right, so the write batching is basically delaying writing out the PMU
> state to hardware until pmu::pmu_enable() time. It avoids having to
> re-program the hardware when, due to a scheduling constraint, we have to
> move counters around.
>
> So say, we context switch a task, and remove the old events and add the
> new ones under a single pmu::pmu_disable()/::pmu_enable() pair, we will
> only hit the hardware twice (once to disable, once to enable), instead
> of for each individual ::del()/::add().
>
> For this to work we need to have an association between a context and a
> pmu, otherwise its very hard to know what pmu to disable/enable; the
> alternative is all of them which isn't very attractive.
>
> Then again, it doesn't make sense to have task-counters on an I2C
> attached PMU simply because writing to the PMU could cause context
> switches.

Thanks for your reply.

In our case, writing to some of the nest PMUs' control registers is done 
via an internal bridge.  We write to a specific memory address and an 
internal MMIO-to-SCOM bridge (SCOM is similar to I2C) translates it to 
serial and sends it over the internal serial bus.  The address we write 
to is based upon the control register's serial bus address, plus an 
offset from the base of MMIO-to-SCOM bridge.  The same process works for 
reads.

While it does not cause a context switch because there are no IO drivers 
to go through, it will take several thousand CPU cycles to complete, 
which by the same token, still makes them inappropriate for 
task-counters (not to mention that the nest units operate asynchronously 
from the CPU).

However, there still are concerns relative to writing these control 
registers from an interrupt handler because of the latency that will be 
incurred, however slow we choose to do the event rotation.  So at least 
for the Wire-Speed processor, we may need a worker thread of some sort 
to hand off the work to.

Our current code, based on linux 2.6.31 (soon to be 2.6.32) doesn't use 
worker threads; we are just taking the latency hit for now.

- Corey

  reply	other threads:[~2010-06-30 17:19 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-24 14:28 [RFC][PATCH 00/11] perf pmu interface -v2 Peter Zijlstra
2010-06-24 14:28 ` [PATCH 01/11] perf, x86: Fix Nehalem PMU quirk Peter Zijlstra
2010-06-24 14:28 ` [PATCH 02/11] perf: Fix argument of perf_arch_fetch_caller_regs Peter Zijlstra
2010-06-24 14:28 ` [PATCH 03/11] perf, sparc64: Fix maybe_change_configuration() PCR setting Peter Zijlstra
2010-06-24 14:28 ` [RFC][PATCH 04/11] perf: deconstify struct pmu Peter Zijlstra
2010-06-24 14:28 ` [RFC][PATCH 05/11] perf: register pmu implementations Peter Zijlstra
2010-06-28 13:21   ` Frederic Weisbecker
2010-06-28 15:16     ` Peter Zijlstra
2010-06-28 15:29       ` Frederic Weisbecker
2010-07-09  3:08   ` Paul Mackerras
2010-07-09  8:14     ` Peter Zijlstra
2010-06-24 14:28 ` [RFC][PATCH 06/11] perf: Unindent labels Peter Zijlstra
2010-06-24 14:28 ` [RFC][PATCH 07/11] perf: Reduce perf_disable() usage Peter Zijlstra
2010-06-24 14:28 ` [RFC][PATCH 08/11] perf: Per PMU disable Peter Zijlstra
2010-07-09  7:31   ` Paul Mackerras
2010-07-09  8:36     ` Peter Zijlstra
2010-06-24 14:28 ` [RFC][PATCH 09/11] perf: Default PMU ops Peter Zijlstra
2010-06-29 14:49   ` Frederic Weisbecker
2010-06-29 14:57     ` Peter Zijlstra
2010-06-29 15:00       ` Frederic Weisbecker
2010-06-29 14:58   ` Frederic Weisbecker
2010-06-29 14:59     ` Peter Zijlstra
2010-06-29 15:03       ` Frederic Weisbecker
2010-06-29 16:34         ` Peter Zijlstra
2010-06-29 18:07           ` Frederic Weisbecker
2010-06-29 18:09             ` Peter Zijlstra
2010-06-29 18:11               ` Frederic Weisbecker
2010-06-29 18:19                 ` Peter Zijlstra
2010-06-29 18:21                   ` Frederic Weisbecker
2010-06-24 14:28 ` [RFC][PATCH 10/11] perf: Shrink hw_perf_event Peter Zijlstra
2010-06-29 15:06   ` Frederic Weisbecker
2010-06-24 14:28 ` [RFC][PATCH 11/11] perf: Rework the PMU methods Peter Zijlstra
2010-06-29 15:37   ` Frederic Weisbecker
2010-06-29 16:40     ` Peter Zijlstra
2010-06-29 18:09       ` Frederic Weisbecker
2010-06-25 11:11 ` [RFC][PATCH 00/11] perf pmu interface -v2 Will Deacon
2010-06-25 11:16   ` Peter Zijlstra
2010-06-25 14:36     ` Will Deacon
2010-06-25 14:50       ` Peter Zijlstra
2010-07-01 14:36         ` Peter Zijlstra
2010-07-01 15:02           ` Peter Zijlstra
2010-07-01 15:31             ` MattFleming
2010-07-01 15:39               ` Peter Zijlstra
2010-07-01 16:04                 ` Matt Fleming
2010-07-02  2:57                 ` Paul Mundt
2010-07-02  9:52                   ` Peter Zijlstra
2010-07-05 11:14                     ` Paul Mundt
2010-07-08 11:13                 ` Peter Zijlstra
2010-07-08 11:19                   ` Ingo Molnar
2010-07-18 19:37                     ` Matt Fleming
2010-07-02 12:55           ` Will Deacon
2010-06-26 11:22 ` Matt Fleming
2010-06-26 16:22 ` Corey Ashford
2010-06-28 15:13   ` Peter Zijlstra
2010-06-30 17:19     ` Corey Ashford [this message]
2010-06-30 18:11       ` 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=4C2B7C9F.5070100@linux.vnet.ibm.com \
    --to=cjashfor@linux.vnet.ibm.com \
    --cc=davem@davemloft.net \
    --cc=dengcheng.zhu@gmail.com \
    --cc=eranian@googlemail.com \
    --cc=fweisbec@gmail.com \
    --cc=gorcunov@gmail.com \
    --cc=lethal@linux-sh.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ming.m.lin@intel.com \
    --cc=paulus@samba.org \
    --cc=peterz@infradead.org \
    --cc=robert.richter@amd.com \
    --cc=will.deacon@arm.com \
    --cc=yanmin_zhang@linux.intel.com \
    /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;
as well as URLs for NNTP newsgroup(s).