Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755819AbbEUOKk (ORCPT ); Thu, 21 May 2015 10:10:40 -0400 Received: from casper.infradead.org ([85.118.1.10]:41901 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754105AbbEUOKj (ORCPT ); Thu, 21 May 2015 10:10:39 -0400 Date: Thu, 21 May 2015 16:10:34 +0200 From: Peter Zijlstra To: Stephane Eranian Cc: Ingo Molnar , Vince Weaver , Jiri Olsa , LKML Subject: Re: [PATCH 03/10] perf/x86: Correct local vs remote sibling state Message-ID: <20150521141034.GT3644@twins.programming.kicks-ass.net> References: <20150521111710.475482798@infradead.org> <20150521111932.797565087@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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: 1505 Lines: 38 On Thu, May 21, 2015 at 06:31:25AM -0700, Stephane Eranian wrote: > On Thu, May 21, 2015 at 4:17 AM, Peter Zijlstra wrote: > > For some obscure reason the current code accounts the current SMT > > thread's state on the remote thread and reads the remote's state on > > the local SMT thread. > > > > While internally consistent, and 'correct' its pointless confusion we > > can do without. > > > > Flip them the right way around. > > > So you are changing the logic here from: > > * EXCLUSIVE: sibling counter measuring exclusive event > * SHARED : sibling counter measuring non-exclusive event > * UNUSED : sibling counter unused > > to: > > * EXCLUSIVE: current thread is using an exclusive event > * SHARED: current thread is using a non-exclusive event > * UNUSED: current thread is not using this counter > > I am okay with this just need to make sure there were no > assumptions made about that. I will look. Right; and when we construct the constraint mask we look at the other one too. So both on the update and the read side I flipped things around. And that is really the only thing that matters, that you look at the other sibling's thread state when constructing that mask. And that's kept invariant. -- 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/