Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751012AbcKHNOf (ORCPT ); Tue, 8 Nov 2016 08:14:35 -0500 Received: from mx1.redhat.com ([209.132.183.28]:52008 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750724AbcKHNOe (ORCPT ); Tue, 8 Nov 2016 08:14:34 -0500 Date: Tue, 8 Nov 2016 14:14:30 +0100 From: Jiri Olsa To: Peter Zijlstra Cc: Jiri Olsa , Vince Weaver , Robert Richter , Yan Zheng , lkml , Ingo Molnar , Andi Kleen Subject: Re: [PATCH] perf/x86: Fix overlap counter scheduling bug Message-ID: <20161108131430.GB4777@krava> References: <1478015068-14052-1-git-send-email-jolsa@kernel.org> <20161108122039.GP3142@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161108122039.GP3142@twins.programming.kicks-ass.net> User-Agent: Mutt/1.7.1 (2016-10-04) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 08 Nov 2016 13:14:33 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1097 Lines: 35 On Tue, Nov 08, 2016 at 01:20:39PM +0100, Peter Zijlstra wrote: SNIP > Now, I would much rather solve this by changing the constraint like the > below, that yields: > > 0x01 - 0001 > 0x03 - 0011 > > 0x0c - 1100 > > Which is two distinct groups, only one of which has overlap. And the one > with overlap only has 2 overlapping masks, giving a max reties of 1. works for me.. thanks, jirka > > > 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 */ > UNCORE_EVENT_CONSTRAINT(0x21, 0x3), > UNCORE_EVENT_CONSTRAINT(0x23, 0x3), > UNCORE_EVENT_CONSTRAINT(0x31, 0x3),