Re: [PATCH RFC V4 4/5] kvm : pv-ticketlocks support for linux guests running on KVM hypervisor

2012-01-24 Thread Raghavendra K T
On 01/18/2012 12:27 AM, Raghavendra K T wrote: On 01/17/2012 04:32 PM, Marcelo Tosatti wrote: On Sat, Jan 14, 2012 at 11:56:46PM +0530, Raghavendra K T wrote: [...] + || (vcpu->requests& ~(1UL

Re: [PATCH RFC V4 4/5] kvm : pv-ticketlocks support for linux guests running on KVM hypervisor

2012-01-24 Thread Raghavendra K T
On 01/24/2012 07:38 PM, Avi Kivity wrote: On 01/18/2012 11:52 PM, Jeremy Fitzhardinge wrote: On 01/19/2012 12:54 AM, Srivatsa Vaddagiri wrote: That logic relies on the "kick" being level triggered, so that "kick" before "block" will cause the block to fall out immediately. If you're using "h

Re: [PATCH RFC V4 4/5] kvm : pv-ticketlocks support for linux guests running on KVM hypervisor

2012-01-24 Thread Avi Kivity
On 01/18/2012 11:52 PM, Jeremy Fitzhardinge wrote: > On 01/19/2012 12:54 AM, Srivatsa Vaddagiri wrote: > > > >> That logic relies on the "kick" being level triggered, so that "kick" > >> before "block" will cause the block to fall out immediately. If you're > >> using "hlt" as the block and it has

Re: [PATCH RFC V4 4/5] kvm : pv-ticketlocks support for linux guests running on KVM hypervisor

2012-01-18 Thread Jeremy Fitzhardinge
On 01/19/2012 12:54 AM, Srivatsa Vaddagiri wrote: > >> That logic relies on the "kick" being level triggered, so that "kick" >> before "block" will cause the block to fall out immediately. If you're >> using "hlt" as the block and it has the usual edge-triggered behaviour, >> what stops a "kick-be

Re: [PATCH RFC V4 4/5] kvm : pv-ticketlocks support for linux guests running on KVM hypervisor

2012-01-18 Thread Srivatsa Vaddagiri
* Jeremy Fitzhardinge [2012-01-18 12:34:42]: > >> What prevents a kick from being lost here, if say, the waiter is at > >> local_irq_save in kvm_lock_spinning, before the lock/want assignments? > > The waiter does check for lock becoming available before actually > > sleeping: > > > > + /* > >

Re: [PATCH RFC V4 4/5] kvm : pv-ticketlocks support for linux guests running on KVM hypervisor

2012-01-17 Thread Jeremy Fitzhardinge
On 01/17/2012 10:33 PM, Srivatsa Vaddagiri wrote: > * Marcelo Tosatti [2012-01-17 09:02:11]: > >>> +/* Kick vcpu waiting on @lock->head to reach value @ticket */ >>> +static void kvm_unlock_kick(struct arch_spinlock *lock, __ticket_t ticket) >>> +{ >>> + int cpu; >>> + int apicid; >>> + >>> +

Re: [PATCH RFC V4 4/5] kvm : pv-ticketlocks support for linux guests running on KVM hypervisor

2012-01-17 Thread Raghavendra K T
On 01/17/2012 04:32 PM, Marcelo Tosatti wrote: On Sat, Jan 14, 2012 at 11:56:46PM +0530, Raghavendra K T wrote: Extends Linux guest running on KVM hypervisor to support pv-ticketlocks. diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index c7b05fc..4d7a950 100644 --- a/arch/x86/kvm/x86.c +++

Re: [PATCH RFC V4 4/5] kvm : pv-ticketlocks support for linux guests running on KVM hypervisor

2012-01-17 Thread Srivatsa Vaddagiri
* Marcelo Tosatti [2012-01-17 09:02:11]: > > +/* Kick vcpu waiting on @lock->head to reach value @ticket */ > > +static void kvm_unlock_kick(struct arch_spinlock *lock, __ticket_t ticket) > > +{ > > + int cpu; > > + int apicid; > > + > > + add_stats(RELEASED_SLOW, 1); > > + > > + for_each

Re: [PATCH RFC V4 4/5] kvm : pv-ticketlocks support for linux guests running on KVM hypervisor

2012-01-17 Thread Marcelo Tosatti
On Sat, Jan 14, 2012 at 11:56:46PM +0530, Raghavendra K T wrote: > Extends Linux guest running on KVM hypervisor to support pv-ticketlocks. > > During smp_boot_cpus paravirtualied KVM guest detects if the hypervisor has > required feature (KVM_FEATURE_PVLOCK_KICK) to support pv-ticketlocks. If s

Re: [PATCH RFC V4 4/5] kvm : pv-ticketlocks support for linux guests running on KVM hypervisor

2012-01-16 Thread Jeremy Fitzhardinge
On 01/17/2012 01:47 AM, Avi Kivity wrote: > On 01/16/2012 04:13 PM, Raghavendra K T wrote: >>> Please drop all of these and replace with tracepoints in the appropriate >>> spots. Everything else (including the historgram) can be reconstructed >>> the tracepoints in userspace. >>> >> >> I think Jer

Re: [PATCH RFC V4 4/5] kvm : pv-ticketlocks support for linux guests running on KVM hypervisor

2012-01-16 Thread Avi Kivity
On 01/16/2012 04:13 PM, Raghavendra K T wrote: >> Please drop all of these and replace with tracepoints in the appropriate >> spots. Everything else (including the historgram) can be reconstructed >> the tracepoints in userspace. >> > > > I think Jeremy pointed that tracepoints use spinlocks and h

Re: [PATCH RFC V4 4/5] kvm : pv-ticketlocks support for linux guests running on KVM hypervisor

2012-01-16 Thread Raghavendra K T
On 01/16/2012 02:35 PM, Avi Kivity wrote: On 01/14/2012 08:26 PM, Raghavendra K T wrote: Extends Linux guest running on KVM hypervisor to support pv-ticketlocks. During smp_boot_cpus paravirtualied KVM guest detects if the hypervisor has required feature (KVM_FEATURE_PVLOCK_KICK) to support pv

Re: [PATCH RFC V4 4/5] kvm : pv-ticketlocks support for linux guests running on KVM hypervisor

2012-01-16 Thread Avi Kivity
On 01/14/2012 08:26 PM, Raghavendra K T wrote: > Extends Linux guest running on KVM hypervisor to support pv-ticketlocks. > > During smp_boot_cpus paravirtualied KVM guest detects if the hypervisor has > required feature (KVM_FEATURE_PVLOCK_KICK) to support pv-ticketlocks. If so, > support for p

Re: [PATCH RFC V4 4/5] kvm : pv-ticketlocks support for linux guests running on KVM hypervisor

2012-01-15 Thread Raghavendra K T
On 01/16/2012 08:42 AM, Alexander Graf wrote: On 14.01.2012, at 19:26, Raghavendra K T wrote: Extends Linux guest running on KVM hypervisor to support pv-ticketlocks. During smp_boot_cpus paravirtualied KVM guest detects if the hypervisor has required feature (KVM_FEATURE_PVLOCK_KICK) to sup

Re: [PATCH RFC V4 4/5] kvm : pv-ticketlocks support for linux guests running on KVM hypervisor

2012-01-15 Thread Alexander Graf
On 14.01.2012, at 19:26, Raghavendra K T wrote: > Extends Linux guest running on KVM hypervisor to support pv-ticketlocks. > > During smp_boot_cpus paravirtualied KVM guest detects if the hypervisor has > required feature (KVM_FEATURE_PVLOCK_KICK) to support pv-ticketlocks. If so, > support fo

[PATCH RFC V4 4/5] kvm : pv-ticketlocks support for linux guests running on KVM hypervisor

2012-01-14 Thread Raghavendra K T
Extends Linux guest running on KVM hypervisor to support pv-ticketlocks. During smp_boot_cpus paravirtualied KVM guest detects if the hypervisor has required feature (KVM_FEATURE_PVLOCK_KICK) to support pv-ticketlocks. If so, support for pv-ticketlocks is registered via pv_lock_ops. Use KVM_HC