From: Tim Deegan Subject: Re: [PATCH v3] Xen: Spread boot time page scrubbing across all available CPU's Date: Mon, 14 Apr 2014 00:38:52 +0200 Message-ID: <20140413223852.GH99209@deinos.phlegethon.org> References: <1397239681-16522-1-git-send-email-konrad@kernel.org> <1397239681-16522-2-git-send-email-konrad@kernel.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1397239681-16522-2-git-send-email-konrad@kernel.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Konrad Rzeszutek Wilk Cc: keir@xen.org, andrew.cooper3@citrix.com, dario.faggioli@citrix.com, xen-devel@lists.xen.org, JBeulich@suse.com, malcolm.crossley@citrix.com List-Id: xen-devel@lists.xenproject.org Hi, Thanks for picking this up! One or two comments: At 14:08 -0400 on 11 Apr (1397221681), Konrad Rzeszutek Wilk wrote: > + /* Calculate the end mfn into this CPU's memory block for this iteration */ > + if ( r->offset + chunk_size > r->per_cpu_sz ) { > + end = r->start + (r->per_cpu_sz * cpu_idx) + r->per_cpu_sz; > + if ( r->rem && ((cpumask_weight(&r->cpu) - 1 == cpu_idx )) ) > + end += r->rem; I think the outer gate here needs to be a '>=' to handle the case where per_cpu_sz % chunk_size == 0 but node_spaned_pages() % per_cpu_sz != 0. > + } > + else > + end = start + chunk_size; > + [...] > + /* Round default chunk size down if required */ > + if ( max_per_cpu_sz && chunk_size > max_per_cpu_sz ) > + chunk_size = max_per_cpu_sz; Is this necessary? The worker function should DTRT with a too-large chunk size. (Likewise in round #2) Cheers, Tim.