From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751796AbbE0OAz (ORCPT ); Wed, 27 May 2015 10:00:55 -0400 Received: from one.firstfloor.org ([193.170.194.197]:54736 "EHLO one.firstfloor.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751440AbbE0OAy (ORCPT ); Wed, 27 May 2015 10:00:54 -0400 Date: Wed, 27 May 2015 16:00:52 +0200 From: Andi Kleen To: Peter Zijlstra Cc: Andi Kleen , mingo@kernel.org, vincent.weaver@maine.edu, eranian@google.com, jolsa@redhat.com, kan.liang@intel.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 02/11] perf/x86: Improve HT workaround GP counter constraint Message-ID: <20150527140051.GS19417@two.firstfloor.org> References: <20150522132905.416122812@infradead.org> <20150522133135.447912500@infradead.org> <87h9qy29t5.fsf@tassilo.jf.intel.com> <20150527074809.GU3644@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150527074809.GU3644@twins.programming.kicks-ass.net> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 27, 2015 at 09:48:09AM +0200, Peter Zijlstra wrote: > On Tue, May 26, 2015 at 04:33:42PM -0700, Andi Kleen wrote: > > Peter Zijlstra writes: > > > + */ > > > + if (is_ht_workaround_enabled() && !cpuc->is_fake && > > > > Could this function also check if at least one leaking event is > > scheduled somewhere? (e.g. from a global count) > > You truncated one line too many: > > + if (is_ht_workaround_enabled() && !cpuc->is_fake && > + READ_ONCE(cpuc->excl_cntrs->exclusive_present)) > + gpmax /= 2; > > Guess what that READ_ONCE() does? It checks if there's one such leaky > event on the current core. Great. Thanks. -Andi -- ak@linux.intel.com -- Speaking for myself only.