From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH] KVM_SET_MEMORY_REGION hang in linux 2.6.23.y Date: Wed, 21 Nov 2007 08:56:28 +0200 Message-ID: <4743D69C.7000808@qumranet.com> References: <20071120223802.7afe5d00@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org To: Marko Kohtala Return-path: In-Reply-To: <20071120223802.7afe5d00-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org Marko Kohtala wrote: > Wait for right amount of tlb flushes. Completed can be larger than > needed and therefore the loop waiting them to match never ends. > > Signed-off-by: Marko Kohtala > > --- > > This solves kernel lockup in KVM_SET_MEMORY_REGION ioctl with Linux > 2.6.23.8 and before at kvm-52 start. Not needed in 2.6.24. > > diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c > index cd05579..b148aff 100644 > --- a/drivers/kvm/kvm_main.c > +++ b/drivers/kvm/kvm_main.c > @@ -279,7 +279,8 @@ void kvm_flush_remote_tlbs(struct kvm *kvm) > * to complete. > */ > for (cpu = first_cpu(cpus); cpu != NR_CPUS; cpu = next_cpu(cpu, cpus)) > - smp_call_function_single(cpu, ack_flush, &completed, 1, 0); > + if (cpu_isset(cpu, cpus)) > + smp_call_function_single(cpu, ack_flush, &completed, 1, 0); > Can you explain how this makes a difference? Aren't first_cpu() and next_cpu() designed to iterate over all cpus which have cpu_isset(cpus)? -- Any sufficiently difficult bug is indistinguishable from a feature. ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/