From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752715AbbE0Hsb (ORCPT ); Wed, 27 May 2015 03:48:31 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:34946 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752222AbbE0Hs1 (ORCPT ); Wed, 27 May 2015 03:48:27 -0400 Date: Wed, 27 May 2015 09:48:09 +0200 From: Peter Zijlstra To: Andi Kleen Cc: 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: <20150527074809.GU3644@twins.programming.kicks-ass.net> References: <20150522132905.416122812@infradead.org> <20150522133135.447912500@infradead.org> <87h9qy29t5.fsf@tassilo.jf.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87h9qy29t5.fsf@tassilo.jf.intel.com> 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 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.