Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751953AbcDZNx5 (ORCPT ); Tue, 26 Apr 2016 09:53:57 -0400 Received: from foss.arm.com ([217.140.101.70]:54728 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750835AbcDZNx4 (ORCPT ); Tue, 26 Apr 2016 09:53:56 -0400 Date: Tue, 26 Apr 2016 14:53:54 +0100 From: Will Deacon To: Jan Glauber Cc: Mark Rutland , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, David Daney Subject: Re: [PATCH v2 0/5] Cavium ThunderX uncore PMU support Message-ID: <20160426135354.GR27312@arm.com> References: <20160404121954.GA9300@hardcore> <20160425112207.GL16065@arm.com> <20160425120222.GA2552@hardcore> <20160425131907.GB30830@arm.com> <20160426120809.GA9796@hardcore> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160426120809.GA9796@hardcore> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2667 Lines: 61 On Tue, Apr 26, 2016 at 02:08:09PM +0200, Jan Glauber wrote: > On Mon, Apr 25, 2016 at 02:19:07PM +0100, Will Deacon wrote: > > On Mon, Apr 25, 2016 at 02:02:22PM +0200, Jan Glauber wrote: > > > On Mon, Apr 25, 2016 at 12:22:07PM +0100, Will Deacon wrote: > > > > On Mon, Apr 04, 2016 at 02:19:54PM +0200, Jan Glauber wrote: > > > > > can you have a look at these patches? > > > > > > > > Looks like Mark reviewed this last week -- are you planning to respin? > > > > > > Yes, of course. I just had no time yet and I'm a bit lost on how to > > > proceed without using the NUMA node information which Mark did not like > > > to be used. > > > > > > The only way to know which device is on which node would be to look > > > at the PCI topology (which is also the source of the NUMA node_id). > > > We could do this manually in order to not depend on CONFIG_NUMA, > > > but I would like to know if that is acceptable before respinning the > > > patches. > > > > That doesn't feel like it really addresses Mark's concerns -- it's just > > another way to get the information that isn't a first-class PMU topology > > description from firmware. > > > > Now, I don't actually mind using the NUMA topology so much in the cases > > where it genuinely correlates with the PMU topology. My objection is more > > that we end up sticking everything on node 0 if !CONFIG_NUMA, which could > > result in working with an incorrect PMU topology and passing all of that > > through to userspace. > > > > So I'd prefer either making the driver depend on NUMA, or at the very least > > failing to probe the PMU if we discover a socketed system and NUMA is not > > selected. Do either of those work as a compromise? > > > > Will > > That sounds like a good compromise. > > So I could do the following: > > 1) In the uncore setup check for CONFIG_NUMA, if set use the NUMA > information to determine the device node > > 2) If CONFIG_NUMA is not set we check if we run on a socketed system > > a) In that case we return an error and give a message that CONFIG_NUMA needs > to be enabled > b) Otherwise we have a single node system and use node_id = 0 That sounds sensible to me. How do you "check if we run on a socketed system"? My assumption would be that you could figure this out from the firmware tables? > David noted that it would also be possible to extract the node id from > the physical address of the device, but I'm not sure that classifies as > 'first-class' topology description... I'd rather avoid this sort of probing, as it inevitably breaks when it sees new hardware that doesn't follow the unwritten assumptions of the old hardware. Will