From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linutronix.de (146.0.238.70:993) by crypto-ml.lab.linutronix.de with IMAP4-SSL for ; 08 Feb 2019 17:26:14 -0000 Received: from mga04.intel.com ([192.55.52.120]) by Galois.linutronix.de with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1gs9un-0007WB-4u for speck@linutronix.de; Fri, 08 Feb 2019 18:26:13 +0100 Date: Fri, 8 Feb 2019 09:26:09 -0800 From: Andi Kleen Subject: [MODERATED] Re: [PATCH v3 2/6] PERFv3 Message-ID: <20190208172609.GB16922@tassilo.jf.intel.com> References: <3dd5d6e2bc9ac53f826c251c68ce84fcc79a6872.1549582769.git.ak@linux.intel.com> <20190208085050.GJ32477@hirez.programming.kicks-ass.net> MIME-Version: 1.0 In-Reply-To: <20190208085050.GJ32477@hirez.programming.kicks-ass.net> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit To: speck@linutronix.de List-ID: On Fri, Feb 08, 2019 at 09:50:50AM +0100, speck for Peter Zijlstra wrote: > On Thu, Feb 07, 2019 at 03:41:04PM -0800, speck for Andi Kleen wrote: > > +static struct event_constraint * > > +skl_get_event_constraints(struct cpu_hw_events *cpuc, int idx, > > + struct perf_event *event) > > +{ > > + struct event_constraint *c; > > + > > + c = hsw_get_event_constraints(cpuc, idx, event); > > + > > + if (!perf_enable_all_counters) { > > + cpuc->counter3_constraint = *c; > > + c = &cpuc->counter3_constraint; > > + > > + /* > > + * Without TFA we must not use PMC3. > > + */ > > + __clear_bit(3, c->idxmsk); > > + } > > + > > + return c; > > +} > > This is obviously broken... what if all 6 events are in use and have > different constraints? Don't understand the comment. Why 6? The intention is that if more than 3 generic events are in use it will not schedule. I tested this and it works. -Andi