From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: [PATCH] Xen: Spread boot time page scrubbing across all available CPU's (v7) Date: Fri, 13 Jun 2014 15:45:01 -0400 Message-ID: <20140613194501.GA29208@laptop.dumpdata.com> References: <1402686657-28922-1-git-send-email-konrad.wilk@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WvXPU-0006Kh-2u for xen-devel@lists.xenproject.org; Fri, 13 Jun 2014 19:45:12 +0000 Content-Disposition: inline In-Reply-To: <1402686657-28922-1-git-send-email-konrad.wilk@oracle.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xenproject.org, JBeulich@suse.com, andrew.cooper3@citrix.com, tim@xen.org, dario.faggioli@citrix.com, julien.grall@linaro.org Cc: konrad@kernel.org, malcolm.crossley@citrix.com List-Id: xen-devel@lists.xenproject.org . groan.. > + /* > + * Use CPUs from best node, and if there are no CPUs on the > + * first node (the default) use the BSP. > + */ > + if ( find_non_smt(best_node, &node_cpus) == 0 ) > + cpumask_set_cpu(smp_processor_id(), &node_cpus); > > - spin_unlock(&heap_lock); > + /* We already have the node information from round #0. */ > + region[i].rem = region[i].per_cpu_sz % cpumask_weight(&node_cpus); > + region[i].per_cpu_sz /= cpumask_weight(&node_cpus); And we can use 'cpus' here as well, like: diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c index 5af1361..f1c0676 100644 --- a/xen/common/page_alloc.c +++ b/xen/common/page_alloc.c @@ -1451,12 +1451,15 @@ void __init scrub_heap_pages(void) * Use CPUs from best node, and if there are no CPUs on the * first node (the default) use the BSP. */ - if ( find_non_smt(best_node, &node_cpus) == 0 ) + cpus = find_non_smt(best_node, &node_cpus); + if ( cpus == 0 ) + { cpumask_set_cpu(smp_processor_id(), &node_cpus); - + cpus = 1; + } /* We already have the node information from round #0. */ - region[i].rem = region[i].per_cpu_sz % cpumask_weight(&node_cpus); - region[i].per_cpu_sz /= cpumask_weight(&node_cpus); + region[i].rem = region[i].per_cpu_sz % cpus; + region[i].per_cpu_sz /= cpus; max_per_cpu_sz = region[i].per_cpu_sz; cpumask_copy(®ion[i].cpus, &node_cpus); Will post another patch