From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH RFC 3/4] Paravirtualized spinlock implementation for KVM guests Date: Mon, 02 Aug 2010 11:53:03 +0300 Message-ID: <4C56876F.5000804@redhat.com> References: <20100726061150.GB21699@linux.vnet.ibm.com> <20100726061537.GC8402@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Marcelo Tosatti , Gleb Natapov , linux-kernel@vger.kernel.org, npiggin@suse.de, Jeremy Fitzhardinge , kvm@vger.kernel.org, bharata@in.ibm.com, Balbir Singh , Jan Beulich To: vatsa@linux.vnet.ibm.com Return-path: In-Reply-To: <20100726061537.GC8402@linux.vnet.ibm.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On 07/26/2010 09:15 AM, Srivatsa Vaddagiri wrote: > Paravirtual spinlock implementation for KVM guests, based heavily on Xen guest's > spinlock implementation. > > +static void kvm_spin_unlock(struct arch_spinlock *lock) > +{ > + struct kvm_spinlock *sl = (struct kvm_spinlock *)lock; > + > + ADD_STATS(released, 1); > + > + smp_wmb(); /* make sure no writes get moved after unlock */ > + sl->lock = 0; /* release lock */ > +} Wait, no wakeup? So it is a yield, not a sleep. I'm worried it could seriously impact fairness when one non-contending guest (or non-pv) is overcommitted together with a spin-yield guest. -- error compiling committee.c: too many arguments to function