Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755562AbbHCUt3 (ORCPT ); Mon, 3 Aug 2015 16:49:29 -0400 Received: from mga01.intel.com ([192.55.52.88]:5047 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752171AbbHCUt2 (ORCPT ); Mon, 3 Aug 2015 16:49:28 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,603,1432623600"; d="scan'208";a="777028146" Date: Mon, 3 Aug 2015 13:49:27 -0700 (PDT) From: Vikas Shivappa X-X-Sender: vikas@vshiva-Udesk To: Peter Zijlstra cc: Vikas Shivappa , linux-kernel@vger.kernel.org, vikas.shivappa@intel.com, x86@kernel.org, hpa@zytor.com, tglx@linutronix.de, mingo@kernel.org, tj@kernel.org, matt.fleming@intel.com, will.auld@intel.com, glenn.p.williamson@intel.com, kanaka.d.juvva@intel.com Subject: Re: [PATCH 9/9] x86/intel_rdt: Intel haswell Cache Allocation enumeration In-Reply-To: <20150729163502.GY25159@twins.programming.kicks-ass.net> Message-ID: References: <1435789270-27010-1-git-send-email-vikas.shivappa@linux.intel.com> <1435789270-27010-10-git-send-email-vikas.shivappa@linux.intel.com> <20150729163502.GY25159@twins.programming.kicks-ass.net> User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1440 Lines: 42 On Wed, 29 Jul 2015, Peter Zijlstra wrote: > On Wed, Jul 01, 2015 at 03:21:10PM -0700, Vikas Shivappa wrote: >> + boot_cpu_data.x86_cache_max_closid = 4; >> + boot_cpu_data.x86_cache_max_cbm_len = 20; > > That's just vile. And I'm surprised it even works, I would've expected > boot_cpu_data to be const. This is updated only once as the cpuid enum is not done for hsw servers. For all the hsw servers these numbers are always the same and hence hardcoded , the comment says its hardcoded ,will update a comment to include this info as well. > > So the CQM code has paranoid things like: > > max_rmid = MAX_INT; > for_each_possible_cpu(cpu) > max_rmid = min(max_rmid, cpu_data(cpu)->x86_cache_max_rmid); > > And then uses max_rmid. This has the advantage that if you mix parts in > a multi-socket environment and hotplug socket 0 to a later part which a > bigger {rm,clos}id your allocation isn't suddenly too small. > > Please do similar things and only ever look at cpu_data once, at init > time. Cache alloc is under CPU_SUP_INTEL and all the cores should have the same features. We use the bsp structure in cache alloc which should have the minimum features. Thanks, Vikas > -- 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/