[PATCH RFC V11 0/18] Paravirtualized ticket spinlocks

2013-07-22 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 V11: - use safe_halt in lock_spinning path to avoid potential problem in case of irq_handlers taking lock in

[PATCH RFC V11 1/18] x86/spinlock: Replace pv spinlocks with pv ticketlocks

2013-07-22 Thread Raghavendra K T
x86/spinlock: Replace pv spinlocks with pv ticketlocks From: Jeremy Fitzhardinge jer...@goop.org 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 (long spin on

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

2013-07-22 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 V11 3/18] x86/ticketlock: Collapse a layer of functions

2013-07-22 Thread Raghavendra K T
x86/ticketlock: Collapse a layer of functions From: Jeremy Fitzhardinge jer...@goop.org 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 jer...@goop.org

[PATCH RFC V11 4/18] xen: Defer spinlock setup until boot CPU setup

2013-07-22 Thread Raghavendra K T
xen: Defer spinlock setup until boot CPU setup From: Jeremy Fitzhardinge jer...@goop.org 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 jer...@goop.org Reviewed-by: Konrad Rzeszutek Wilk

[PATCH RFC V11 5/18] xen/pvticketlock: Xen implementation for PV ticket locks

2013-07-22 Thread Raghavendra K T
xen/pvticketlock: Xen implementation for PV ticket locks From: Jeremy Fitzhardinge jer...@goop.org 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 lock_waiting, adds

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

2013-07-22 Thread Raghavendra K T
xen/pvticketlocks: Add xen_nopvspin parameter to disable xen pv ticketlocks From: Jeremy Fitzhardinge jer...@goop.org Signed-off-by: Jeremy Fitzhardinge jer...@goop.org Reviewed-by: Konrad Rzeszutek Wilk konrad.w...@oracle.com Signed-off-by: Raghavendra K T raghavendra...@linux.vnet.ibm.com ---

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

2013-07-22 Thread Raghavendra K T
x86/pvticketlock: When paravirtualizing ticket locks, increment by 2 From: Jeremy Fitzhardinge jer...@goop.org 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 size, but this

[PATCH RFC V11 7/18] x86/pvticketlock: Use callee-save for lock_spinning

2013-07-22 Thread Raghavendra K T
x86/pvticketlock: Use callee-save for lock_spinning From: Jeremy Fitzhardinge jer...@goop.org 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 pre/postamble, which is

[PATCH RFC V11 9/18] jump_label: Split out rate limiting from jump_label.h

2013-07-22 Thread Raghavendra K T
jump_label: Split jumplabel ratelimit From: Andrew Jones drjo...@redhat.com Commit b202952075f62603bea9bfb6ebc6b0420db11949 (perf, core: Rate limit perf_sched_events jump_label patching) introduced rate limiting for jump label disabling. The changes were made in the jump label code in order to

[PATCH RFC V11 10/18] x86/ticketlock: Add slowpath logic

2013-07-22 Thread Raghavendra K T
x86/ticketlock: Add slowpath logic From: Jeremy Fitzhardinge jer...@goop.org 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 enters the

[PATCH RFC V11 12/18] kvm hypervisor : Add a hypercall to KVM hypervisor to support pv-ticketlocks

2013-07-22 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 V11 13/18] kvm : Fold pv_unhalt flag into GET_MP_STATE ioctl to aid migration

2013-07-22 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 V11 11/18] xen/pvticketlock: Allow interrupts to be enabled while blocking

2013-07-22 Thread Raghavendra K T
xen/pvticketlock: Allow interrupts to be enabled while blocking From: Jeremy Fitzhardinge jer...@goop.org 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 become available,

[PATCH RFC V11 14/18] kvm guest : Add configuration support to enable debug information for KVM Guests

2013-07-22 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 V11 15/18] kvm : Paravirtual ticketlocks support for linux guests running on KVM hypervisor

2013-07-22 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 V11 18/18] kvm hypervisor: Add directed yield in vcpu block path

2013-07-22 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 V11 16/18] kvm hypervisor : Simplify kvm_for_each_vcpu with kvm_irq_delivery_to_apic

2013-07-22 Thread Raghavendra K T
kvm hypervisor: 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

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

2013-07-22 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

Re: [PATCH v2 00/11] virtio: console: fixes for port unplug

2013-07-22 Thread Jason Wang
On 07/19/2013 07:21 PM, Amit Shah wrote: Hello, This series fixes a few bugs and races with port unplug and the various file operations: read(), write(), close() and poll(). There still might be more races lurking, but testing this series looks good to at least solve the easily-triggerable

Re: [PATCH V3 0/2] [BUGFIX] virtio/console: Fix two bugs of splice_write

2013-07-22 Thread Amit Shah
On (Mon) 22 Jul 2013 [13:00:43], Yoshihiro YUNOMAE wrote: Hi, This patch set fixes two bugs of splice_write in the virtio-console driver. [BUG1] Although pipe-nrbufs is empty, the driver tries to do splice_write. = This induces oops in sg_init_table(). [BUG2] No lock for

Re: [PULL] vhost: cleanups and fixes

2013-07-22 Thread Michael S. Tsirkin
On Mon, Jul 15, 2013 at 09:31:49PM +0300, Michael S. Tsirkin wrote: The following changes since commit 09a34c8404c1d4c5782de319c02e1d742c57875c: vhost/test: update test after vhost cleanups (2013-07-07 18:02:25 +0300) are available in the git repository at:

Re: is kexec on Xen domU possible?

2013-07-22 Thread Daniel Kiper
On Fri, Jul 19, 2013 at 01:58:05PM -0700, H. Peter Anvin wrote: On 07/19/2013 12:14 PM, Greg KH wrote: The errors that the kexec tools seem to run into is finding the memory to place the new kernel into, is that just an issue that PV guests aren't given enough kernel memory in which to

Re: is kexec on Xen domU possible?

2013-07-22 Thread Eric W. Biederman
Daniel Kiper daniel.ki...@oracle.com writes: On Fri, Jul 19, 2013 at 01:58:05PM -0700, H. Peter Anvin wrote: On 07/19/2013 12:14 PM, Greg KH wrote: The errors that the kexec tools seem to run into is finding the memory to place the new kernel into, is that just an issue that PV guests

Re: is kexec on Xen domU possible?

2013-07-22 Thread H. Peter Anvin
On 07/22/2013 10:20 AM, Eric W. Biederman wrote: Also, in any virtualized environment the hypervisor can do a better job for things like kdump, simply because it can provide two things that are otherwise hard to do: 1. a known-good system state; 2. a known-clean kdump image. As such, I do

Re: [PATCH RFC V11 0/18] Paravirtualized ticket spinlocks

2013-07-22 Thread Konrad Rzeszutek Wilk
github link: https://github.com/ktraghavendra/linux/tree/pvspinlock_v11 And chance you have a backup git tree? I get: This repository is temporarily unavailable. Please note that we set SPIN_THRESHOLD = 32k with this series, that would eatup little bit of overcommit performance of PLE

Re: is kexec on Xen domU possible?

2013-07-22 Thread H. Peter Anvin
On 07/22/2013 11:33 AM, Greg KH wrote: I don't care about kdump, I care about kexec on domU for people who are running on cloud providers with old versions of Xen so that they can control what kernel they can boot, when they want to boot it. If kdump works as well, that's just a bonus, but

[patch v2] virtio: console: cleanup an error message

2013-07-22 Thread Dan Carpenter
The PTR_ERR(NULL) here is not useful. Signed-off-by: Dan Carpenter dan.carpen...@oracle.com --- v2: completely different diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c index 1b456fe..4cf46d8 100644 --- a/drivers/char/virtio_console.c +++

Re: [PATCH 06/10] virtio: console: fix race in port_fops_poll() and port unplug

2013-07-22 Thread Rusty Russell
Amit Shah amit.s...@redhat.com writes: On (Fri) 19 Jul 2013 [18:17:32], Jason Wang wrote: On 07/19/2013 03:48 PM, Amit Shah wrote: On (Fri) 19 Jul 2013 [15:03:50], Jason Wang wrote: On 07/19/2013 04:16 AM, Amit Shah wrote: Between poll() being called and processed, the port can be

Re: [PATCH RFC V11 0/18] Paravirtualized ticket spinlocks

2013-07-22 Thread Raghavendra K T
On 07/23/2013 01:06 AM, Konrad Rzeszutek Wilk wrote: github link: https://github.com/ktraghavendra/linux/tree/pvspinlock_v11 And chance you have a backup git tree? I get: This repository is temporarily unavailable. I only have it on local apart from there :(. Hope it was a temporary github

Re: [PATCH 06/10] virtio: console: fix race in port_fops_poll() and port unplug

2013-07-22 Thread Jason Wang
On 07/22/2013 01:45 PM, Rusty Russell wrote: Amit Shah amit.s...@redhat.com writes: On (Fri) 19 Jul 2013 [18:17:32], Jason Wang wrote: On 07/19/2013 03:48 PM, Amit Shah wrote: On (Fri) 19 Jul 2013 [15:03:50], Jason Wang wrote: On 07/19/2013 04:16 AM, Amit Shah wrote: Between poll() being

Re: [PATCH V3 0/2] [BUGFIX] virtio/console: Fix two bugs of splice_write

2013-07-22 Thread Rusty Russell
Amit Shah amit.s...@redhat.com writes: On (Mon) 22 Jul 2013 [13:00:43], Yoshihiro YUNOMAE wrote: Hi, This patch set fixes two bugs of splice_write in the virtio-console driver. [BUG1] Although pipe-nrbufs is empty, the driver tries to do splice_write. = This induces oops in

Re: [patch v2] virtio: console: cleanup an error message

2013-07-22 Thread Greg Kroah-Hartman
On Mon, Jul 22, 2013 at 11:41:00PM +0300, Dan Carpenter wrote: The PTR_ERR(NULL) here is not useful. Signed-off-by: Dan Carpenter dan.carpen...@oracle.com --- v2: completely different diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c index 1b456fe..4cf46d8 100644