[PATCH RFC V9 0/19] Paravirtualized ticket spinlocks

2013-06-01 Thread Raghavendra K T
This series replaces the existing paravirtualized spinlock mechanism with a paravirtualized ticketlock mechanism. The series provides implementation for both Xen and KVM. Changes in V9: - Changed spin_threshold to 32k to avoid excess halt exits that are causing undercommit degradation (after

[PATCH RFC V9 0/19] Paravirtualized ticket spinlocks

2013-06-01 Thread Raghavendra K T
This series replaces the existing paravirtualized spinlock mechanism with a paravirtualized ticketlock mechanism. The series provides implementation for both Xen and KVM. Changes in V9: - Changed spin_threshold to 32k to avoid excess halt exits that are causing undercommit degradation (after

[PATCH RFC V9 1/19] x86/spinlock: Replace pv spinlocks with pv ticketlocks

2013-06-01 Thread Raghavendra K T
x86/spinlock: Replace pv spinlocks with pv ticketlocks From: Jeremy Fitzhardinge jeremy.fitzhardi...@citrix.com Rather than outright replacing the entire spinlock implementation in order to paravirtualize it, keep the ticket lock implementation but add a couple of pvops hooks on the slow patch

[PATCH RFC V9 2/19] x86/ticketlock: Don't inline _spin_unlock when using paravirt spinlocks

2013-06-01 Thread Raghavendra K T
x86/ticketlock: Don't inline _spin_unlock when using paravirt spinlocks From: Raghavendra K T raghavendra...@linux.vnet.ibm.com The code size expands somewhat, and its better to just call a function rather than inline it. Thanks Jeremy for original version of ARCH_NOINLINE_SPIN_UNLOCK config

[PATCH RFC V9 3/19] x86/ticketlock: Collapse a layer of functions

2013-06-01 Thread Raghavendra K T
x86/ticketlock: Collapse a layer of functions From: Jeremy Fitzhardinge jeremy.fitzhardi...@citrix.com Now that the paravirtualization layer doesn't exist at the spinlock level any more, we can collapse the __ticket_ functions into the arch_ functions. Signed-off-by: Jeremy Fitzhardinge

[PATCH RFC V9 4/19] xen: Defer spinlock setup until boot CPU setup

2013-06-01 Thread Raghavendra K T
xen: Defer spinlock setup until boot CPU setup From: Jeremy Fitzhardinge jeremy.fitzhardi...@citrix.com There's no need to do it at very early init, and doing it there makes it impossible to use the jump_label machinery. Signed-off-by: Jeremy Fitzhardinge jeremy.fitzhardi...@citrix.com

[PATCH RFC V9 5/19] xen/pvticketlock: Xen implementation for PV ticket locks

2013-06-01 Thread Raghavendra K T
xen/pvticketlock: Xen implementation for PV ticket locks From: Jeremy Fitzhardinge jeremy.fitzhardi...@citrix.com Replace the old Xen implementation of PV spinlocks with and implementation of xen_lock_spinning and xen_unlock_kick. xen_lock_spinning simply registers the cpu in its entry in

[PATCH RFC V9 9/19] Split out rate limiting from jump_label.h

2013-06-01 Thread Raghavendra K T
Split jumplabel ratelimit From: Andrew Jones drjo...@redhat.com Commit b202952075f62603bea9bfb6ebc6b0420db11949 introduced rate limiting for jump label disabling. The changes were made in the jump label code in order to be more widely available and to keep things tidier. This is all fine, except

[PATCH RFC V9 7/19] x86/pvticketlock: Use callee-save for lock_spinning

2013-06-01 Thread Raghavendra K T
x86/pvticketlock: Use callee-save for lock_spinning From: Jeremy Fitzhardinge jeremy.fitzhardi...@citrix.com Although the lock_spinning calls in the spinlock code are on the uncommon path, their presence can cause the compiler to generate many more register save/restores in the function

[PATCH RFC V9 8/19] x86/pvticketlock: When paravirtualizing ticket locks, increment by 2

2013-06-01 Thread Raghavendra K T
x86/pvticketlock: When paravirtualizing ticket locks, increment by 2 From: Jeremy Fitzhardinge jeremy.fitzhardi...@citrix.com Increment ticket head/tails by 2 rather than 1 to leave the LSB free to store a is in slowpath state bit. This halves the number of possible CPUs for a given ticket

[PATCH RFC V9 6/19] xen/pvticketlocks: Add xen_nopvspin parameter to disable xen pv ticketlocks

2013-06-01 Thread Raghavendra K T
xen/pvticketlocks: Add xen_nopvspin parameter to disable xen pv ticketlocks From: Jeremy Fitzhardinge jeremy.fitzhardi...@citrix.com Signed-off-by: Jeremy Fitzhardinge jeremy.fitzhardi...@citrix.com Reviewed-by: Konrad Rzeszutek Wilk konrad.w...@oracle.com Signed-off-by: Raghavendra K T

[PATCH RFC V9 11/19] xen/pvticketlock: Allow interrupts to be enabled while blocking

2013-06-01 Thread Raghavendra K T
xen/pvticketlock: Allow interrupts to be enabled while blocking From: Jeremy Fitzhardinge jeremy.fitzhardi...@citrix.com If interrupts were enabled when taking the spinlock, we can leave them enabled while blocking to get the lock. If we can enable interrupts while waiting for the lock to

[PATCH RFC V9 16/19] kvm : Paravirtual ticketlocks support for linux guests running on KVM hypervisor

2013-06-01 Thread Raghavendra K T
kvm : Paravirtual ticketlocks support for linux guests running on KVM hypervisor From: Srivatsa Vaddagiri va...@linux.vnet.ibm.com During smp_boot_cpus paravirtualied KVM guest detects if the hypervisor has required feature (KVM_FEATURE_PV_UNHALT) to support pv-ticketlocks. If so, support for

[PATCH RFC V9 12/19] xen: Enable PV ticketlocks on HVM Xen

2013-06-01 Thread Raghavendra K T
xen: Enable PV ticketlocks on HVM Xen From: Stefano Stabellini stefano.stabell...@eu.citrix.com Signed-off-by: Jeremy Fitzhardinge jeremy.fitzhardi...@citrix.com Reviewed-by: Konrad Rzeszutek Wilk konrad.w...@oracle.com Signed-off-by: Raghavendra K T raghavendra...@linux.vnet.ibm.com ---

[PATCH RFC V9 14/19] kvm : Fold pv_unhalt flag into GET_MP_STATE ioctl to aid migration

2013-06-01 Thread Raghavendra K T
kvm : Fold pv_unhalt flag into GET_MP_STATE ioctl to aid migration From: Raghavendra K T raghavendra...@linux.vnet.ibm.com During migration, any vcpu that got kicked but did not become runnable (still in halted state) should be runnable after migration. Signed-off-by: Raghavendra K T

[PATCH RFC V9 15/19] kvm guest : Add configuration support to enable debug information for KVM Guests

2013-06-01 Thread Raghavendra K T
kvm guest : Add configuration support to enable debug information for KVM Guests From: Srivatsa Vaddagiri va...@linux.vnet.ibm.com Signed-off-by: Srivatsa Vaddagiri va...@linux.vnet.ibm.com Signed-off-by: Suzuki Poulose suz...@in.ibm.com Signed-off-by: Raghavendra K T

[PATCH RFC V9 17/19] kvm hypervisor : Simplify kvm_for_each_vcpu with kvm_irq_delivery_to_apic

2013-06-01 Thread Raghavendra K T
Simplify kvm_for_each_vcpu with kvm_irq_delivery_to_apic From: Raghavendra K T raghavendra...@linux.vnet.ibm.com Note that we are using APIC_DM_REMRD which has reserved usage. In future if APIC_DM_REMRD usage is standardized, then we should find some other way or go back to old method.

[PATCH RFC V9 18/19] Documentation/kvm : Add documentation on Hypercalls and features used for PV spinlock

2013-06-01 Thread Raghavendra K T
Documentation/kvm : Add documentation on Hypercalls and features used for PV spinlock From: Raghavendra K T raghavendra...@linux.vnet.ibm.com KVM_HC_KICK_CPU hypercall added to wakeup halted vcpu in paravirtual spinlock enabled guest. KVM_FEATURE_PV_UNHALT enables guest to check whether pv

[PATCH RFC V9 13/19] kvm hypervisor : Add a hypercall to KVM hypervisor to support pv-ticketlocks

2013-06-01 Thread Raghavendra K T
kvm hypervisor : Add a hypercall to KVM hypervisor to support pv-ticketlocks From: Srivatsa Vaddagiri va...@linux.vnet.ibm.com kvm_hc_kick_cpu allows the calling vcpu to kick another vcpu out of halt state. the presence of these hypercalls is indicated to guest via kvm_feature_pv_unhalt.

[PATCH RFC V9 19/19] kvm hypervisor: Add directed yield in vcpu block path

2013-06-01 Thread Raghavendra K T
kvm hypervisor: Add directed yield in vcpu block path From: Raghavendra K T raghavendra...@linux.vnet.ibm.com We use the improved PLE handler logic in vcpu block patch for scheduling rather than plain schedule, so that we can make intelligent decisions Signed-off-by: Raghavendra K T

[PATCH RFC V9 10/19] x86/ticketlock: Add slowpath logic

2013-06-01 Thread Raghavendra K T
x86/ticketlock: Add slowpath logic From: Jeremy Fitzhardinge jeremy.fitzhardi...@citrix.com Maintain a flag in the LSB of the ticket lock tail which indicates whether anyone is in the lock slowpath and may need kicking when the current holder unlocks. The flags are set when the first locker

Re: [PATCH RFC V9 0/19] Paravirtualized ticket spinlocks

2013-06-01 Thread Andi Kleen
FWIW I use the paravirt spinlock ops for adding lock elision to the spinlocks. This needs to be done at the top level (so the level you're removing) However I don't like the pv mechanism very much and would be fine with using an static key hook in the main path like I do for all the other lock

Re: [PATCH RFC V9 0/19] Paravirtualized ticket spinlocks

2013-06-01 Thread Jeremy Fitzhardinge
On 06/01/2013 01:14 PM, Andi Kleen wrote: FWIW I use the paravirt spinlock ops for adding lock elision to the spinlocks. Does lock elision still use the ticketlock algorithm/structure, or are they different? If they're still basically ticketlocks, then it seems to me that they're complimentary

Re: [PATCH RFC V9 1/19] x86/spinlock: Replace pv spinlocks with pv ticketlocks

2013-06-01 Thread Jeremy Fitzhardinge
On 06/01/2013 12:21 PM, Raghavendra K T wrote: x86/spinlock: Replace pv spinlocks with pv ticketlocks From: Jeremy Fitzhardinge jeremy.fitzhardi...@citrix.com I'm not sure what the etiquette is here; I did the work while at Citrix, but jer...@goop.org is my canonical email address. The Citrix

Re: [PATCH RFC V9 0/19] Paravirtualized ticket spinlocks

2013-06-01 Thread Andi Kleen
On Sat, Jun 01, 2013 at 01:28:00PM -0700, Jeremy Fitzhardinge wrote: On 06/01/2013 01:14 PM, Andi Kleen wrote: FWIW I use the paravirt spinlock ops for adding lock elision to the spinlocks. Does lock elision still use the ticketlock algorithm/structure, or are they different? If they're