From: Keir Fraser Subject: Re: [PATCH] Avoid endless loop for vcpu migration Date: Tue, 15 Mar 2011 09:58:37 +0000 Message-ID: References: <4D7F2F98.8090900@ts.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4D7F2F98.8090900@ts.fujitsu.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Juergen Gross , Jan Beulich Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On 15/03/2011 09:21, "Juergen Gross" wrote: >> That candidate-is-valid check seems absolutely independent of the >> particular scheduler used, and hence could be done in the (sole) >> caller, thus not requiring any change to the scheduler interface. >> >> Which at once would eliminate unnecessary calls into pick_cpu (i.e. >> you'd call it a second time only if the previously selected CPU really >> is no longer valid to be used for that vCPU). > > True. > > The patch seems to become smaller :-) By the way, why is the cpu_isset(new_cpu, v->domain->vcpupool->cpu_valid) check required (after calling pick_cpu, in the cuirrently checked-in code)? You already check that pick_cpu was called holding the correct pair of locks, if it has returned a cpu that is not in the pool's cpu_valid mask, what would make pick_cpu return anything different on the next invocation thus avoiding an endless loop? Looks like this question would remain even if this new patch was applied. -- Keir