[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH RFC V4 0/5] kvm : Paravirt-spinlock support for KVM guests

On 01/16/2012 07:55 PM, Avi Kivity wrote:
> On 01/16/2012 08:40 AM, Jeremy Fitzhardinge wrote:
>>> That means we're spinning for n cycles, then notify the spinlock holder 
>>> that we'd like to get kicked and go sleeping. While I'm pretty sure that it 
>>> improves the situation, it doesn't solve all of the issues we have.
>>> Imagine we have an idle host. All vcpus can freely run and everyone can 
>>> fetch the lock as fast as on real machines. We don't need to / want to go 
>>> to sleep here. Locks that take too long are bugs that need to be solved on 
>>> real hw just as well, so all we do is possibly incur overhead.
>> I'm not quite sure what your concern is.  The lock is under contention, so 
>> there's nothing to do except spin; all this patch adds is a variable 
>> decrement/test to the spin loop, but that's not going to waste any more CPU 
>> than the non-counting case.  And once it falls into the blocking path, its a 
>> win because the VCPU isn't burning CPU any more.
> The wakeup path is slower though.  The previous lock holder has to
> hypercall, and the new lock holder has to be scheduled, and transition
> from halted state to running (a vmentry).  So it's only a clear win if
> we can do something with the cpu other than go into the idle loop.

Not burning power is a win too.

Actually what you want is something like "if you preempt a VCPU while
its spinning in a lock, then push it into the slowpath and don't
reschedule it without a kick".  But I think that interface would have a
lot of fiddly corners.


Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.