From: Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com>
To: Jeremy Fitzhardinge <jeremy@goop.org>,
Greg Kroah-Hartman <gregkh@suse.de>,
Alexander Graf <agraf@suse.de>,
Randy Dunlap <rdunlap@xenotime.net>,
Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
KVM <kvm@vger.kernel.org>,
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
linux-doc@vger.kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
Marcelo Tosatti <mtosatti@redhat.com>, X86 <x86@kernel.org>,
Gleb Natapov <gleb@redhat.com>, Ingo Molnar <mingo@redhat.com>,
Avi Kivity <avi@redhat.com>,
Virtualization <virtualization@lists.linux-foundation.org>,
LKML <linux-kernel@vger.kernel.org>
Cc: Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com>,
Xen <xen-devel@lists.xensource.com>,
Srivatsa Vaddagiri <vatsa@linux.vnet.ibm.com>,
Sasha Levin <levinsasha928@gmail.com>
Subject: [PATCH RFC V6 0/5] kvm : Paravirt-spinlock support for KVM guests
Date: Mon, 23 Apr 2012 15:29:37 +0530 [thread overview]
Message-ID: <20120423095937.30893.14776.sendpatchset@codeblue.in.ibm.com> (raw)
The 5-patch series to follow this email extends KVM-hypervisor and Linux guest
running on KVM-hypervisor to support pv-ticket spinlocks, based on Xen's
implementation.
One hypercall is introduced in KVM hypervisor,that allows a vcpu to kick
another vcpu out of halt state.
The blocking of vcpu is done using halt() in (lock_spinning) slowpath.
Note: 1) patch is based on 3.4-rc3 + ticketlock patches in
https://lkml.org/lkml/2012/4/19/335
[ The patches are targeted for 3.5 window ]
Changes in V6:
- Rebased to 3.4-rc3
- Removed debugfs changes patch which should now be in Xen/linux-next.
(https://lkml.org/lkml/2012/3/30/687)
- Removed PV_UNHALT_MSR since currently we don't need guest communication,
and made pv_unhalt folded to GET_MP_STATE (Marcello, Avi[long back])
- Take jumplabel changes from Ingo/Jason into use (static_key_slow_inc usage)
- Added inline to spinlock_init in non PARAVIRT case
- Move arch specific code to arch/x86 and add stubs to other archs (Marcello)
- Added more comments on pv_unhalt usage etc (Marcello)
Changes in V5:
- rebased to 3.3-rc6
- added PV_UNHALT_MSR that would help in live migration (Avi)
- removed PV_LOCK_KICK vcpu request and pv_unhalt flag (re)added.
- Changed hypercall documentaion (Alex).
- mode_t changed to umode_t in debugfs.
- MSR related documentation added.
- rename PV_LOCK_KICK to PV_UNHALT.
- host and guest patches not mixed. (Marcelo, Alex)
- kvm_kick_cpu now takes cpu so it can be used by flush_tlb_ipi_other
paravirtualization (Nikunj)
- coding style changes in variable declarion etc (Srikar)
Changes in V4:
- reabsed to 3.2.0 pre.
- use APIC ID for kicking the vcpu and use kvm_apic_match_dest for matching (Avi)
- fold vcpu->kicked flag into vcpu->requests (KVM_REQ_PVLOCK_KICK) and related
changes for UNHALT path to make pv ticket spinlock migration friendly(Avi, Marcello)
- Added Documentation for CPUID, Hypercall (KVM_HC_KICK_CPU)
and capabilty (KVM_CAP_PVLOCK_KICK) (Avi)
- Remove unneeded kvm_arch_vcpu_ioctl_set_mpstate call. (Marcello)
- cumulative variable type changed (int ==> u32) in add_stat (Konrad)
- remove unneeded kvm_guest_init for !CONFIG_KVM_GUEST case
Changes in V3:
- rebased to 3.2-rc1
- use halt() instead of wait for kick hypercall.
- modify kick hyper call to do wakeup halted vcpu.
- hook kvm_spinlock_init to smp_prepare_cpus call (moved the call out of head##.c).
- fix the potential race when zero_stat is read.
- export debugfs_create_32 and add documentation to API.
- use static inline and enum instead of ADDSTAT macro.
- add barrier() in after setting kick_vcpu.
- empty static inline function for kvm_spinlock_init.
- combine the patches one and two readuce overhead.
- make KVM_DEBUGFS depends on DEBUGFS.
- include debugfs header unconditionally.
Changes in V2:
- rebased patchesto -rc9
- synchronization related changes based on Jeremy's changes
(Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>) pointed by
Stephan Diestelhorst <stephan.diestelhorst@amd.com>
- enabling 32 bit guests
- splitted patches into two more chunks
Results:
results for PLE / non PLE machine were posted for V5 patches in
https://lkml.org/lkml/2012/3/23/50
https://lkml.org/lkml/2012/4/5/73
Current series is giving similar results but more formal results will
be posted in next couple of days.
Interestingly with current patchset I do not see CPU stalls observed in vanilla.
TODO: 1) remove CONFIG_PARAVIRT_SPINLOCK ?
2) experiments on further optimization possibilities.
(discussed in V6 of ticketlock)
3) possible debugfs cleanups (combining common code of Xen/KVM)
Let me know if you have any sugestion/comments...
---
V5 kernel changes:
https://lkml.org/lkml/2012/3/23/50
Qemu changes for V5:
http://lists.gnu.org/archive/html/qemu-devel/2012-03/msg04455.html
V4 kernel changes:
https://lkml.org/lkml/2012/1/14/66
Qemu changes for V4:
http://www.mail-archive.com/kvm@vger.kernel.org/msg66450.html
V3 kernel Changes:
https://lkml.org/lkml/2011/11/30/62
V2 kernel changes :
https://lkml.org/lkml/2011/10/23/207
Previous discussions : (posted by Srivatsa V).
https://lkml.org/lkml/2010/7/26/24
https://lkml.org/lkml/2011/1/19/212
Qemu patch for V3:
http://lists.gnu.org/archive/html/qemu-devel/2011-12/msg00397.html
Srivatsa Vaddagiri (3):
Add a hypercall to KVM hypervisor to support pv-ticketlocks
Added configuration support to enable debug information for KVM Guests
pv-ticketlock support for linux guests running on KVM hypervisor
Raghavendra K T (2):
Fold pv_unhalt flag into GET_MP_STATE ioctl to aid migration
Add documentation on Hypercalls and features used for PV spinlock
Documentation/virtual/kvm/api.txt | 7 +
Documentation/virtual/kvm/cpuid.txt | 4 +
Documentation/virtual/kvm/hypercalls.txt | 59 +++++++
arch/ia64/include/asm/kvm_host.h | 3 +
arch/powerpc/include/asm/kvm_host.h | 4 +
arch/s390/include/asm/kvm_host.h | 4 +
arch/x86/Kconfig | 9 +
arch/x86/include/asm/kvm_host.h | 6 +
arch/x86/include/asm/kvm_para.h | 16 ++-
arch/x86/kernel/kvm.c | 254 ++++++++++++++++++++++++++++++
arch/x86/kvm/cpuid.c | 3 +-
arch/x86/kvm/x86.c | 46 ++++++-
include/linux/kvm.h | 1 +
include/linux/kvm_para.h | 1 +
virt/kvm/kvm_main.c | 8 +
15 files changed, 421 insertions(+), 4 deletions(-)
next reply other threads:[~2012-04-23 9:59 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-23 9:59 Raghavendra K T [this message]
2012-04-23 9:59 ` [PATCH RFC V6 1/5] kvm hypervisor : Add a hypercall to KVM hypervisor to support pv-ticketlocks Raghavendra K T
2012-04-24 9:59 ` Gleb Natapov
2012-04-26 8:11 ` Raghavendra K T
2012-04-27 10:45 ` Raghavendra K T
2012-04-27 15:53 ` Gleb Natapov
2012-06-28 18:17 ` Raghavendra K T
2012-04-29 13:18 ` Avi Kivity
2012-04-29 13:20 ` Gleb Natapov
2012-04-29 13:26 ` Avi Kivity
2012-04-29 13:52 ` Gleb Natapov
2012-04-30 8:22 ` Avi Kivity
2012-04-30 8:38 ` Gleb Natapov
2012-04-29 13:25 ` Avi Kivity
2012-04-30 7:44 ` Raghavendra K T
2012-04-30 8:19 ` Avi Kivity
2012-05-01 20:20 ` Raghavendra K T
2012-04-23 10:00 ` [PATCH RFC V6 2/5] kvm : Fold pv_unhalt flag into GET_MP_STATE ioctl to aid migration Raghavendra K T
2012-04-29 13:27 ` Avi Kivity
2012-04-30 7:45 ` Raghavendra K T
2012-04-23 10:00 ` [PATCH RFC V6 3/5] kvm guest : Add configuration support to enable debug information for KVM Guests Raghavendra K T
2012-04-23 10:00 ` [PATCH RFC V6 4/5] kvm : pv-ticketlocks support for linux guests running on KVM hypervisor Raghavendra K T
2012-04-23 10:00 ` [PATCH RFC V6 5/5] Documentation/kvm : Add documentation on Hypercalls and features used for PV spinlock Raghavendra K T
2012-04-26 15:57 ` Rob Landley
2012-04-26 16:04 ` Raghavendra K T
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120423095937.30893.14776.sendpatchset@codeblue.in.ibm.com \
--to=raghavendra.kt@linux.vnet.ibm.com \
--cc=agraf@suse.de \
--cc=avi@redhat.com \
--cc=gleb@redhat.com \
--cc=gregkh@suse.de \
--cc=hpa@zytor.com \
--cc=jeremy@goop.org \
--cc=konrad.wilk@oracle.com \
--cc=kvm@vger.kernel.org \
--cc=levinsasha928@gmail.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=mtosatti@redhat.com \
--cc=rdunlap@xenotime.net \
--cc=stefano.stabellini@eu.citrix.com \
--cc=vatsa@linux.vnet.ibm.com \
--cc=virtualization@lists.linux-foundation.org \
--cc=x86@kernel.org \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).