From: "Jan Beulich" Subject: Re: [PATCH v6 3/7] x86: initialize per socket cpu map Date: Mon, 20 Jan 2014 13:26:55 +0000 Message-ID: <52DD322F02000078001150C0@nat28.tlf.novell.com> References: <1386236334-15410-1-git-send-email-dongxiao.xu@intel.com> <1386236334-15410-4-git-send-email-dongxiao.xu@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1386236334-15410-4-git-send-email-dongxiao.xu@intel.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Dongxiao Xu Cc: keir@xen.org, Ian.Campbell@citrix.com, stefano.stabellini@eu.citrix.com, andrew.cooper3@citrix.com, dario.faggioli@citrix.com, Ian.Jackson@eu.citrix.com, xen-devel@lists.xen.org, dgdegra@tycho.nsa.gov List-Id: xen-devel@lists.xenproject.org >>> On 05.12.13 at 10:38, Dongxiao Xu wrote: > For each socket in the system, we create a separate bitmap to tag its > related CPUs. This per socket bitmap will be initialized on system > start up, and adjusted when CPU is dynamically online/offline. There's no reasoning here at all why cpu_sibling_mask and cpu_core_mask aren't sufficient. > --- a/xen/arch/x86/smpboot.c > +++ b/xen/arch/x86/smpboot.c > @@ -59,6 +59,9 @@ DEFINE_PER_CPU_READ_MOSTLY(cpumask_var_t, cpu_core_mask); > cpumask_t cpu_online_map __read_mostly; > EXPORT_SYMBOL(cpu_online_map); > > +cpumask_t socket_cpu_map[MAX_NUM_SOCKETS] __read_mostly; > +EXPORT_SYMBOL(socket_cpu_map); And _if_ we really need it, then it should be done in a better way than via a statically sized array, the size of which can't even be overridden on the build and/or hypervisor command line. And there shouldn't be EXPORT_SYMBOL() in new, not directly cloned hypervisor code either. Jan