From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Ehrhardt Date: Wed, 02 Apr 2008 09:17:39 +0000 Subject: Re: [kvm-ppc-devel] [PATCH 2 of 2] Add PowerPC KVM guest wait Message-Id: <47F34F33.2000700@linux.vnet.ibm.com> List-Id: References: <21179d0ab8a62ecc24d1.1206740047@thinkpadL> In-Reply-To: <21179d0ab8a62ecc24d1.1206740047@thinkpadL> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: kvm-ppc@vger.kernel.org Jerone Young wrote: > Add PowerPC KVM guest wait handling support >=20 > This patch handles a guest that is in a wait state. This ensures that the= guest is not allways eating up 100% cpu when it is idle. >=20 > Signed-off-by: Jerone Young >=20 > diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c > --- a/arch/powerpc/kvm/powerpc.c > +++ b/arch/powerpc/kvm/powerpc.c > @@ -164,13 +164,12 @@ void kvmppc_dump_vcpu(struct kvm_vcpu *v [...] > + /* handle guest vcpu that is in wait state */ > + /* XXX eventually replace with kvm_vcpu_block() */ > + if (vcpu->arch.msr & MSR_WE) { ### > + DECLARE_WAITQUEUE(wait, current); > + > + add_wait_queue(&vcpu->wq, &wait); > + > + while (!kvm_cpu_has_interrupt(vcpu) > + && !signal_pending(current) > + && !kvm_arch_vcpu_runnable(vcpu)) { > + =09 > + set_current_state(TASK_INTERRUPTIBLE); > + schedule(); > + } > + =09 > + __set_current_state(TASK_RUNNING); > + remove_wait_queue(&vcpu->wq, &wait); ### We talked about calling kvm_vcpu_block here which does the same. What has b= ecome of it? I mean the check is the same now and the waitqueues too. The only differenc= e is vcpu_load/put which calls kvm_arch_vcpu_load/put which are noops for u= s. I the issues are only caused by the prempt/lockign stuff there - ?is it? - = this could either changed there in kvm_vcpu_block e.g. with a ifdef, a runt= ime if or by moving that to the architectures which support these stuff. > + } >=20 > /* Do some exit accounting. */ --=20 Gr=FCsse / regards,=20 Christian Ehrhardt IBM Linux Technology Center, Open Virtualization ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace _______________________________________________ kvm-ppc-devel mailing list kvm-ppc-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-ppc-devel