From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754500AbbLCV3s (ORCPT ); Thu, 3 Dec 2015 16:29:48 -0500 Received: from casper.infradead.org ([85.118.1.10]:41047 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751118AbbLCV3r (ORCPT ); Thu, 3 Dec 2015 16:29:47 -0500 Date: Thu, 3 Dec 2015 22:29:44 +0100 From: Peter Zijlstra To: Andi Kleen Cc: linux-kernel@vger.kernel.org, mingo@kernel.org, Andi Kleen Subject: Re: [PATCH 2/2] x86, perf: Allow zero PEBS status with only single active event Message-ID: <20151203212944.GB17308@twins.programming.kicks-ass.net> References: <1449177740-5422-1-git-send-email-andi@firstfloor.org> <1449177740-5422-2-git-send-email-andi@firstfloor.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1449177740-5422-2-git-send-email-andi@firstfloor.org> 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 Thu, Dec 03, 2015 at 01:22:20PM -0800, Andi Kleen wrote: > + /* > + * On some CPUs the PEBS status can be zero when PEBS is > + * racing with clearing of GLOBAL_STATUS. > + * > + * Normally we would drop that record, but in the > + * case when there is only a single active PEBS event > + * we can assume it's for that event. > + */ > + if (!pebs_status && cpuc->pebs_enabled && > + !(cpuc->pebs_enabled & (cpuc->pebs_enabled-1))) > + pebs_status = cpuc->pebs_enabled; > + > bit = find_first_bit((unsigned long *)&pebs_status, > x86_pmu.max_pebs_events); > if (bit >= x86_pmu.max_pebs_events) Ah! I think this is the comment I just asked for.