From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753272AbbEZMRl (ORCPT ); Tue, 26 May 2015 08:17:41 -0400 Received: from [85.118.1.10] ([85.118.1.10]:42911 "EHLO casper.infradead.org" rhost-flags-FAIL-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1753227AbbEZMRj (ORCPT ); Tue, 26 May 2015 08:17:39 -0400 Date: Tue, 26 May 2015 14:16:19 +0200 From: Peter Zijlstra To: Stephane Eranian Cc: Ingo Molnar , Vince Weaver , Jiri Olsa , "Liang, Kan" , LKML , Andrew Hunter , Maria Dimakopoulou Subject: Re: [PATCH v2 01/11] perf,x86: Fix event/group validation Message-ID: <20150526121619.GN3644@twins.programming.kicks-ass.net> References: <20150522132905.416122812@infradead.org> <20150522133135.353044581@infradead.org> <20150522134056.GG3644@twins.programming.kicks-ass.net> <20150526101237.GK3644@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 26, 2015 at 04:46:07AM -0700, Stephane Eranian wrote: > On Tue, May 26, 2015 at 3:12 AM, Peter Zijlstra wrote: > > On Tue, May 26, 2015 at 02:24:38AM -0700, Stephane Eranian wrote: > >> On Fri, May 22, 2015 at 6:40 AM, Peter Zijlstra wrote: > >> > On Fri, May 22, 2015 at 03:29:06PM +0200, Peter Zijlstra wrote: > >> >> @@ -788,9 +788,9 @@ int x86_schedule_events(struct cpu_hw_ev > >> >> x86_pmu.start_scheduling(cpuc); > >> >> > >> >> for (i = 0, wmin = X86_PMC_IDX_MAX, wmax = 0; i < n; i++) { > >> >> + cpuc->event_constraint[i] = NULL; > >> > > But where is the code that says: skip reinstalling the constraint > in intel_get_event_constraints() because there is already a (stale) > one? I don't see where that is. IIRC the problem was that the copy from c2 into c1: if (c1 && (c1->flags & PERF_X86_EVENT_DYNAMIC)) { bitmap_copy(c1->idxmsk, c2->idxmsk, X86_PMC_IDX_MAX); c1->weight = c2->weight; c2 = c1; } is incomplete. For instance, flags is not copied, and some code down the line might check that and get wrong flags. I'm not entirely sure I saw misbehaviour, but I figured I'd better close that hole and rule out this is contributing to fail.