From: Peter Zijlstra <peterz@infradead.org>
To: "Liang, Kan" <kan.liang@intel.com>
Cc: Andi Kleen <andi@firstfloor.org>, Jiri Olsa <jolsa@kernel.org>,
Vince Weaver <vince@deater.net>, Robert Richter <rric@kernel.org>,
lkml <linux-kernel@vger.kernel.org>,
Ingo Molnar <mingo@kernel.org>
Subject: Re: [PATCH] perf/x86: Fix overlap counter scheduling bug
Date: Tue, 8 Nov 2016 17:57:49 +0100 [thread overview]
Message-ID: <20161108165749.GJ3117@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <37D7C6CF3E00A74B8858931C1DB2F07750C8D9D0@SHSMSX103.ccr.corp.intel.com>
On Tue, Nov 08, 2016 at 04:22:13PM +0000, Liang, Kan wrote:
>
>
> > >
> > >
> > > diff --git a/arch/x86/events/intel/uncore_snbep.c
> > > b/arch/x86/events/intel/uncore_snbep.c
> > > index 272427700d48..71bc348736bd 100644
> > > --- a/arch/x86/events/intel/uncore_snbep.c
> > > +++ b/arch/x86/events/intel/uncore_snbep.c
> > > @@ -669,7 +669,7 @@ static struct event_constraint
> > snbep_uncore_cbox_constraints[] = {
> > > UNCORE_EVENT_CONSTRAINT(0x1c, 0xc),
> > > UNCORE_EVENT_CONSTRAINT(0x1d, 0xc),
> > > UNCORE_EVENT_CONSTRAINT(0x1e, 0xc),
> > > - EVENT_CONSTRAINT_OVERLAP(0x1f, 0xe, 0xff),
> > > + UNCORE_EVENT_CONSTRAINT(0x1f, 0xc); /* should be 0x0e but that
> > gives
> > > +scheduling pain */
>
> I think the crash is caused by the overlap bit.
> Why not just revert the previous patch?
>
> If overlap bit is removed, the perf_sched_save_state will never be touched.
> Why we have to reduce a counter?
By simply removing the overlap bit you'll still get bad scheduling
(we'll just not crash).
I think all the 0x3 mask need the overlap flag set, since they clearly
overlap with the 0x1 masks. That would improve the scheduling.
But as Jiri noted, you cannot do 0x1 + 0x3 + 0xc + 0xe without also
raising the retry limit, because that are 4 overlapping masks, you'll
have to, worst case, pop 3 attempts.
By reducing 0xe to 0xc you'll not have 4 overlapping masks anymore.
In any case, overlapping masks stink (because they make scheduling
O(n!)) and ideally hardware would not do this.
next prev parent reply other threads:[~2016-11-08 16:57 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-01 15:44 [PATCH] perf/x86: Fix overlap counter scheduling bug Jiri Olsa
2016-11-08 12:20 ` Peter Zijlstra
2016-11-08 13:14 ` Jiri Olsa
2016-11-08 15:09 ` Andi Kleen
2016-11-08 16:22 ` Liang, Kan
2016-11-08 16:57 ` Peter Zijlstra [this message]
2016-11-08 17:25 ` Liang, Kan
2016-11-08 18:27 ` Peter Zijlstra
2016-11-09 14:25 ` Robert Richter
2016-11-09 15:51 ` Peter Zijlstra
2016-11-10 8:00 ` Ingo Molnar
2016-11-10 16:41 ` Peter Zijlstra
2016-12-14 15:59 ` Jiri Olsa
2016-12-22 16:50 ` [tip:perf/urgent] " tip-bot for 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=20161108165749.GJ3117@twins.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=andi@firstfloor.org \
--cc=jolsa@kernel.org \
--cc=kan.liang@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=rric@kernel.org \
--cc=vince@deater.net \
/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