From: Peter Zijlstra <peterz@infradead.org>
To: Robert Richter <robert.richter@amd.com>
Cc: Stephane Eranian <eranian@google.com>,
Ingo Molnar <mingo@elte.hu>, Andi Kleen <andi@firstfloor.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v4 0/2] perf, x86: handle overlapping counters
Date: Fri, 18 Nov 2011 16:10:17 +0100 [thread overview]
Message-ID: <1321629017.2197.3.camel@twins> (raw)
In-Reply-To: <1321616122-1533-1-git-send-email-robert.richter@amd.com>
On Fri, 2011-11-18 at 12:35 +0100, Robert Richter wrote:
> I know there is an ongoing discussion about the best algorithm to be
> used for this problem. Posting this version with the latest updates
> anyway...
>
> This patch set implements support for overlapping counters (patch #2).
> For this the existing x86 event scheduler is reworked by introducing
> helper functions (patch #1).
>
> Version 4 of the patch set fixes a bug in the event assignment. There was a
> problem if the first event's weight (index 0) is not the minimum weight. In
> this case the event was assigned twice leaving another event uninitialized
> which caused a GP while accessing counter msrs. Fixes this by proper
> initialzing the first event in perf_sched_init().
OK, I've queued these and tested them using something like:
Index: linux-2.6/arch/x86/kernel/cpu/perf_event_intel.c
===================================================================
--- linux-2.6.orig/arch/x86/kernel/cpu/perf_event_intel.c
+++ linux-2.6/arch/x86/kernel/cpu/perf_event_intel.c
@@ -88,13 +88,19 @@ static struct extra_reg intel_nehalem_ex
static struct event_constraint intel_westmere_event_constraints[] __read_mostly =
{
- FIXED_EVENT_CONSTRAINT(0x00c0, 0), /* INST_RETIRED.ANY */
- FIXED_EVENT_CONSTRAINT(0x003c, 1), /* CPU_CLK_UNHALTED.CORE */
+// FIXED_EVENT_CONSTRAINT(0x00c0, 0), /* INST_RETIRED.ANY */
+// FIXED_EVENT_CONSTRAINT(0x003c, 1), /* CPU_CLK_UNHALTED.CORE */
/* FIXED_EVENT_CONSTRAINT(0x013c, 2), CPU_CLK_UNHALTED.REF */
INTEL_EVENT_CONSTRAINT(0x51, 0x3), /* L1D */
INTEL_EVENT_CONSTRAINT(0x60, 0x1), /* OFFCORE_REQUESTS_OUTSTANDING */
INTEL_EVENT_CONSTRAINT(0x63, 0x3), /* CACHE_LOCK_CYCLES */
INTEL_EVENT_CONSTRAINT(0xb3, 0x1), /* SNOOPQ_REQUEST_OUTSTANDING */
+
+ EVENT_CONSTRAINT_OVERLAP(0x003c, 0x1|0x2, INTEL_ARCH_EVENT_MASK),
+ EVENT_CONSTRAINT_OVERLAP(0x00c0, 0x2|0x4, INTEL_ARCH_EVENT_MASK),
+ EVENT_CONSTRAINT_OVERLAP(0x4f2e, 0x4|0x8, INTEL_ARCH_EVENT_MASK),
+ EVENT_CONSTRAINT_OVERLAP(0x412e, 0x8|0x1, INTEL_ARCH_EVENT_MASK),
+
EVENT_CONSTRAINT_END
};
To stress the thing, you can quite easily manage to hit that
WARN_ON_ONCE() in there, but I haven't seen things explode yet.
> Robert Richter (2):
> configs: updating misc-x86_64-erda to v3.0.8
> config: updating misc-x86_64-erda.config for ASUS M4A89GTD PRO
>
> configs/misc-x86_64-erda.config | 517 ++++++++++++++++++++++++++++-----------
> 1 files changed, 379 insertions(+), 138 deletions(-)
You sure about that? :-)
next prev parent reply other threads:[~2011-11-18 15:10 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-18 11:35 [PATCH v4 0/2] perf, x86: handle overlapping counters Robert Richter
2011-11-18 11:35 ` [PATCH v4 1/2] perf, x86: Implement event scheduler helper functions Robert Richter
2011-12-06 9:44 ` [tip:perf/core] " tip-bot for Robert Richter
2011-11-18 11:35 ` [PATCH v4 2/2] perf, x86: Fix event scheduler for constraints with overlapping counters Robert Richter
2011-12-06 9:45 ` [tip:perf/core] " tip-bot for Robert Richter
2011-11-18 15:10 ` Peter Zijlstra [this message]
2011-11-18 16:32 ` [PATCH v4 0/2] perf, x86: handle " Robert Richter
2011-11-22 15:26 ` Peter Zijlstra
2011-11-22 16:27 ` Robert Richter
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=1321629017.2197.3.camel@twins \
--to=peterz@infradead.org \
--cc=andi@firstfloor.org \
--cc=eranian@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=robert.richter@amd.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