Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753415AbbDQILZ (ORCPT ); Fri, 17 Apr 2015 04:11:25 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:57401 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751127AbbDQILP (ORCPT ); Fri, 17 Apr 2015 04:11:15 -0400 Date: Fri, 17 Apr 2015 10:11:00 +0200 From: Peter Zijlstra To: Kan Liang Cc: linux-kernel@vger.kernel.org, mingo@kernel.org, acme@infradead.org, eranian@google.com, andi@firstfloor.org Subject: Re: [PATCH V6 4/6] perf, x86: handle multiple records in PEBS buffer Message-ID: <20150417081100.GZ24151@twins.programming.kicks-ass.net> References: <1428597466-8154-1-git-send-email-kan.liang@intel.com> <1428597466-8154-5-git-send-email-kan.liang@intel.com> <20150416125342.GZ23123@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150416125342.GZ23123@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 Content-Length: 1479 Lines: 35 On Thu, Apr 16, 2015 at 02:53:42PM +0200, Peter Zijlstra wrote: > When the PEBS interrupt threshold is larger than one record and the > machine supports multiple PEBS events, the records of these events are > mixed up and we need to demultiplex them. > > Demuxing the records is hard because the hardware is deficient. The > hardware has two issues that, when combined, create impossible scenarios > to demux. > > The first issue is that the 'status' field of the PEBS record is a copy > of the GLOBAL_STATUS MSR at PEBS assist time. To see why this is a > problem let us first describe the regular PEBS cycle: > > A) the CTRn value reaches 0: > - the corresponding bit in GLOBAL_STATUS gets set > - we start arming the hardware assist > > < some unspecified amount of time later -- > this could cover multiple events of interest > > > B) the hardware assist is armed, any next event will trigger it > > C) a matching event happens: > - the hardware assist triggers and generates a PEBS record > this includes a copy of GLOBAL_STATUS at this moment > - if we auto-reload we (re)set CTRn Is this actually true? Do we reload here or on A ? > - we clear the relevant bit in GLOBAL_STATUS -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/