From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752383AbdBNSiW (ORCPT ); Tue, 14 Feb 2017 13:38:22 -0500 Received: from bombadil.infradead.org ([65.50.211.133]:51063 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752005AbdBNSiP (ORCPT ); Tue, 14 Feb 2017 13:38:15 -0500 Date: Tue, 14 Feb 2017 19:38:07 +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 , Borislav Petkov , Thomas Gleixner Subject: Re: [PATCH 1/2] perf/x86/intel/pt: Fail event scheduling on conflict with VMX Message-ID: <20170214183807.GT6500@twins.programming.kicks-ass.net> References: <20170214132416.26400-1-alexander.shishkin@linux.intel.com> <20170214132416.26400-2-alexander.shishkin@linux.intel.com> <20170214135620.GN6500@twins.programming.kicks-ass.net> <87d1eklpb9.fsf@ashishki-desk.ger.corp.intel.com> <20170214162702.GR6500@twins.programming.kicks-ass.net> <874lzwlmch.fsf@ashishki-desk.ger.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <874lzwlmch.fsf@ashishki-desk.ger.corp.intel.com> User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 14, 2017 at 07:21:34PM +0200, Alexander Shishkin wrote: > Peter Zijlstra writes: > > > On Tue, Feb 14, 2017 at 06:17:30PM +0200, Alexander Shishkin wrote: > >> This is called by pmu::add(), which checks hw.state afterwards and if it > >> finds HES_STOPPED, it returns an error, which event_sched_in() captures > >> and keeps the event in INACTIVE state. Should I add a comment about it? > > > > Egads... so what if ->add() succeeds but we then hit this on > > ->stop()/->start() due to throttle or period adjust? > > It will hang there with hw.state==PERF_HES_STOPPED till the next > sched_out. But that will be the case anyway if VMXON kicks in while PT > is running. Right, so I question the whole 'lets not schedule PT when VMX' premise, it leads to inconsistencies all over. How about we treat it like ->add() succeeded and VMX simply results in no output. Esp. when you then emit 'fake' data into/from a vmlaunch/vmresume instruction.