From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754455AbbLKRCY (ORCPT ); Fri, 11 Dec 2015 12:02:24 -0500 Received: from bombadil.infradead.org ([198.137.202.9]:48877 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751946AbbLKRCX (ORCPT ); Fri, 11 Dec 2015 12:02:23 -0500 Date: Fri, 11 Dec 2015 18:02:18 +0100 From: Peter Zijlstra To: Alexander Shishkin Cc: Ingo Molnar , linux-kernel@vger.kernel.org, vince@deater.net, eranian@google.com, Arnaldo Carvalho de Melo , Mathieu Poirier Subject: Re: [PATCH v0 3/5] perf: Introduce instruction trace filtering Message-ID: <20151211170218.GJ6373@twins.programming.kicks-ass.net> References: <1449840998-29902-1-git-send-email-alexander.shishkin@linux.intel.com> <1449840998-29902-4-git-send-email-alexander.shishkin@linux.intel.com> <20151211150236.GU6356@twins.programming.kicks-ass.net> <87wpslatut.fsf@ashishki-desk.ger.corp.intel.com> <20151211153354.GY6356@twins.programming.kicks-ass.net> <87si39aswc.fsf@ashishki-desk.ger.corp.intel.com> <20151211160136.GA6356@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151211160136.GA6356@twins.programming.kicks-ass.net> 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 Fri, Dec 11, 2015 at 05:01:36PM +0100, Peter Zijlstra wrote: > On Fri, Dec 11, 2015 at 05:48:03PM +0200, Alexander Shishkin wrote: > > > > We can always call the validation thing, we must not call the program > > > thing !ACTIVE is a clear and simple rule. > > > > Ah, but pmu::itrace_filter_setup() does not touch the hardware, > > pmu::start() does. The former keeps an array of, say, MSR values ready > > for programming in event::hw and the latter actually writes the MSRs. So > > the above example should not be a problem. > > > > So in a way validation and programming are split already. And PT, for > > example, won't have it any other way, you can only program stuff into > > the registers while tracing is disabled. > > Yes, I just read that in the last patch. If however we fold the whole > stop/start bits into it, that fails again. > > Hmm.. lemme ponder a bit. Nope, it doesn't matter. Either way around you need serialization. Because while, as proposed, pmu::itrace_filter_setup() does not modify the hardware state, it does modify event state. So it needs to be serialized against concurrent pmu::add().