Re: [Xen-devel] [PATCH v4 0/5] implement vcpu preempted check

2016-10-19 Thread Pan Xinhui
在 2016/10/19 23:58, Juergen Gross 写道: On 19/10/16 12:20, Pan Xinhui wrote: change from v3: add x86 vcpu preempted check patch change from v2: no code change, fix typos, update some comments change from v1: a simplier definition of default vcpu_is_preempted skip

Re: [Xen-devel] [PATCH v7 06/11] x86, paravirt: Add interface to support kvm/xen vcpu preempted check

2016-11-16 Thread Pan Xinhui
在 2016/11/16 18:23, Peter Zijlstra 写道: On Wed, Nov 16, 2016 at 12:19:09PM +0800, Pan Xinhui wrote: Hi, Peter. I think we can avoid a function call in a simpler way. How about below static inline bool vcpu_is_preempted(int cpu) { /* only set in pv case

Re: [Xen-devel] [PATCH v7 06/11] x86, paravirt: Add interface to support kvm/xen vcpu preempted check

2016-11-15 Thread Pan Xinhui
在 2016/11/15 23:47, Peter Zijlstra 写道: On Wed, Nov 02, 2016 at 05:08:33AM -0400, Pan Xinhui wrote: diff --git a/arch/x86/include/asm/paravirt_types.h b/arch/x86/include/asm/paravirt_types.h index 0f400c0..38c3bb7 100644 --- a/arch/x86/include/asm/paravirt_types.h +++ b/arch/x86/include/asm

[Xen-devel] [PATCH v6 03/11] kernel/locking: Drop the overload of {mutex, rwsem}_spin_on_owner

2016-10-27 Thread Pan Xinhui
essaging [kernel.vmlinux] [k] system_call 2.69% sched-messaging [kernel.vmlinux] [k] wait_consider_task Signed-off-by: Pan Xinhui <xinhui@linux.vnet.ibm.com> Acked-by: Christian Borntraeger <borntrae...@de.ibm.com> Tested-by: Juergen Gross <jgr...@suse.com> --- kernel

[Xen-devel] [PATCH v6 02/11] locking/osq: Drop the overload of osq_lock()

2016-10-27 Thread Pan Xinhui
call_common 2.83% sched-messaging [kernel.vmlinux] [k] copypage_power7 2.64% sched-messaging [kernel.vmlinux] [k] rwsem_spin_on_owner 2.00% sched-messaging [kernel.vmlinux] [k] osq_lock Suggested-by: Boqun Feng <boqun.f...@gmail.com> Signed-off-by: Pan Xinhui <xinhui@linux

[Xen-devel] [PATCH v6 11/11] Documentation: virtual: kvm: Support vcpu preempted check

2016-10-27 Thread Pan Xinhui
u has been preempted. Signed-off-by: Pan Xinhui <xinhui@linux.vnet.ibm.com> Acked-by: Radim Krčmář <rkrc...@redhat.com> --- Documentation/virtual/kvm/msr.txt | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Documentation/virtual/kvm/msr.txt b/Documentation/v

[Xen-devel] [PATCH v6 10/11] x86, xen: support vcpu preempted check

2016-10-27 Thread Pan Xinhui
early yielding. A quick test (4 vcpus on 1 physical cpu doing a parallel build job with "make -j 8") reduced system time by about 5% with this patch. Signed-off-by: Juergen Gross <jgr...@suse.com> Signed-off-by: Pan Xinhui <xinhui@linux.vnet.ibm.com> --- arch/x86/xe

[Xen-devel] [PATCH v6 09/11] x86, kernel/kvm.c: support vcpu preempted check

2016-10-27 Thread Pan Xinhui
concurrent) | 3531.4 lpm | 3211.9 lpm System Call Overhead | 10385653.0 lps | 10419979.0 lps Signed-off-by: Pan Xinhui <xinhui@linux.vnet.ibm.com> --- arch/x86/kernel/kvm.c | 12 1 file changed, 12 insertions(+) diff --git a/arch/x86/ker

[Xen-devel] [PATCH v6 07/11] KVM: Introduce kvm_write_guest_offset_cached

2016-10-27 Thread Pan Xinhui
It allows us to update some status or field of one struct partially. We can also save one kvm_read_guest_cached if we just update one filed of the struct regardless of its current value. Signed-off-by: Pan Xinhui <xinhui@linux.vnet.ibm.com> --- include/linux/kvm_host.h | 2 ++ vi

[Xen-devel] [PATCH v6 05/11] s390/spinlock: Provide vcpu_is_preempted

2016-10-27 Thread Pan Xinhui
From: Christian Borntraeger this implements the s390 backend for commit "kernel/sched: introduce vcpu preempted check interface" by reworking the existing smp_vcpu_scheduled into arch_vcpu_is_preempted. We can then also get rid of the local cpu_is_preempted function by

[Xen-devel] [PATCH v6 01/11] kernel/sched: introduce vcpu preempted check interface

2016-10-27 Thread Pan Xinhui
. Suggested-by: Peter Zijlstra (Intel) <pet...@infradead.org> Signed-off-by: Pan Xinhui <xinhui@linux.vnet.ibm.com> Acked-by: Christian Borntraeger <borntrae...@de.ibm.com> Tested-by: Juergen Gross <jgr...@suse.com> --- include/linux/sched.h | 12 1 fil

[Xen-devel] [PATCH v6 04/11] powerpc/spinlock: support vcpu preempted check

2016-10-27 Thread Pan Xinhui
->yiled_count keeps zero on powerNV. So we can just skip the machine type check. Suggested-by: Boqun Feng <boqun.f...@gmail.com> Suggested-by: Peter Zijlstra (Intel) <pet...@infradead.org> Signed-off-by: Pan Xinhui <xinhui@linux.vnet.ibm.com> --- arch/powerpc/include/asm/spinl

[Xen-devel] [PATCH v6 08/11] x86, kvm/x86.c: support vcpu preempted check

2016-10-27 Thread Pan Xinhui
kvm_steal_time ::preempted to indicate that if one vcpu is running or not. Signed-off-by: Pan Xinhui <xinhui@linux.vnet.ibm.com> --- arch/x86/include/uapi/asm/kvm_para.h | 4 +++- arch/x86/kvm/x86.c | 16 2 files changed, 19 insertions(+), 1 deletion(-)

[Xen-devel] [PATCH v6 06/11] x86, paravirt: Add interface to support kvm/xen vcpu preempted check

2016-10-27 Thread Pan Xinhui
the spin loops upon on the retval of vcpu_is_preempted. As kernel has used this interface, So lets support it. To deal with kernel and kvm/xen, add vcpu_is_preempted into struct pv_lock_ops. Then kvm or xen could provide their own implementation to support vcpu_is_preempted. Signed-off-by: Pan

[Xen-devel] [PATCH v6 00/11] implement vcpu preempted check

2016-10-27 Thread Pan Xinhui
79.0 lps Christian Borntraeger (1): s390/spinlock: Provide vcpu_is_preempted Juergen Gross (1): x86, xen: support vcpu preempted check Pan Xinhui (9): kernel/sched: introduce vcpu preempted check interface locking/osq: Drop the overload of osq_lock() kernel/locking: Drop the overload o

Re: [Xen-devel] [PATCH v6 02/11] locking/osq: Drop the overload of osq_lock()

2016-10-30 Thread Pan Xinhui
在 2016/10/30 00:52, Davidlohr Bueso 写道: On Fri, 28 Oct 2016, Pan Xinhui wrote: /* * If we need to reschedule bail... so we can block. + * Use vcpu_is_preempted to detech lock holder preemption issue ^^ detect ok. thanks

[Xen-devel] [PATCH v7 05/11] s390/spinlock: Provide vcpu_is_preempted

2016-11-01 Thread Pan Xinhui
From: Christian Borntraeger this implements the s390 backend for commit "kernel/sched: introduce vcpu preempted check interface" by reworking the existing smp_vcpu_scheduled into arch_vcpu_is_preempted. We can then also get rid of the local cpu_is_preempted function by

[Xen-devel] [PATCH v7 03/11] kernel/locking: Drop the overload of {mutex, rwsem}_spin_on_owner

2016-11-01 Thread Pan Xinhui
essaging [kernel.vmlinux] [k] system_call 2.69% sched-messaging [kernel.vmlinux] [k] wait_consider_task Signed-off-by: Pan Xinhui <xinhui@linux.vnet.ibm.com> Acked-by: Christian Borntraeger <borntrae...@de.ibm.com> Acked-by: Paolo Bonzini <pbonz...@redhat.com> Tested-by: Juer

[Xen-devel] [PATCH v7 06/11] x86, paravirt: Add interface to support kvm/xen vcpu preempted check

2016-11-01 Thread Pan Xinhui
the spin loops upon the retval of vcpu_is_preempted. As kernel has used this interface, So lets support it. To deal with kernel and kvm/xen, add vcpu_is_preempted into struct pv_lock_ops. Then kvm or xen could provide their own implementation to support vcpu_is_preempted. Signed-off-by: Pan Xinhui

[Xen-devel] [PATCH v7 01/11] kernel/sched: introduce vcpu preempted check interface

2016-11-01 Thread Pan Xinhui
. Suggested-by: Peter Zijlstra (Intel) <pet...@infradead.org> Signed-off-by: Pan Xinhui <xinhui@linux.vnet.ibm.com> Acked-by: Christian Borntraeger <borntrae...@de.ibm.com> Acked-by: Paolo Bonzini <pbonz...@redhat.com> Tested-by: Juergen Gross <jgr...@suse.com> -

[Xen-devel] [PATCH v7 02/11] locking/osq: Drop the overload of osq_lock()

2016-11-01 Thread Pan Xinhui
call_common 2.83% sched-messaging [kernel.vmlinux] [k] copypage_power7 2.64% sched-messaging [kernel.vmlinux] [k] rwsem_spin_on_owner 2.00% sched-messaging [kernel.vmlinux] [k] osq_lock Suggested-by: Boqun Feng <boqun.f...@gmail.com> Signed-off-by: Pan Xinhui <xinhui@linux

[Xen-devel] [PATCH v7 00/11] implement vcpu preempted check

2016-11-01 Thread Pan Xinhui
tem Call Overhead | 10385653.0 lps | 10419979.0 lps Christian Borntraeger (1): s390/spinlock: Provide vcpu_is_preempted Juergen Gross (1): x86, xen: support vcpu preempted check Pan Xinhui (9): kernel/sched: introduce vcpu preempted check interface locking/o

[Xen-devel] [PATCH v7 04/11] powerpc/spinlock: support vcpu preempted check

2016-11-01 Thread Pan Xinhui
->yiled_count keeps zero on PowerNV. So we can just skip the machine type check. Suggested-by: Boqun Feng <boqun.f...@gmail.com> Suggested-by: Peter Zijlstra (Intel) <pet...@infradead.org> Signed-off-by: Pan Xinhui <xinhui@linux.vnet.ibm.com> --- arch/powerpc/include/asm/spinlock.h

[Xen-devel] [PATCH v7 09/11] x86, kernel/kvm.c: support vcpu preempted check

2016-11-01 Thread Pan Xinhui
concurrent) | 3531.4 lpm | 3211.9 lpm System Call Overhead | 10385653.0 lps | 10419979.0 lps Signed-off-by: Pan Xinhui <xinhui@linux.vnet.ibm.com> Acked-by: Paolo Bonzini <pbonz...@redhat.com> --- arch/x86/kernel/kvm.c | 12 1 file

[Xen-devel] [PATCH v7 07/11] KVM: Introduce kvm_write_guest_offset_cached

2016-11-01 Thread Pan Xinhui
It allows us to update some status or field of one struct partially. We can also save one kvm_read_guest_cached if we just update one filed of the struct regardless of its current value. Signed-off-by: Pan Xinhui <xinhui@linux.vnet.ibm.com> Acked-by: Paolo Bonzini <pbonz...@r

[Xen-devel] [PATCH v7 11/11] Documentation: virtual: kvm: Support vcpu preempted check

2016-11-01 Thread Pan Xinhui
u has been preempted. Signed-off-by: Pan Xinhui <xinhui@linux.vnet.ibm.com> Acked-by: Radim Krčmář <rkrc...@redhat.com> Acked-by: Paolo Bonzini <pbonz...@redhat.com> --- Documentation/virtual/kvm/msr.txt | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git

[Xen-devel] [PATCH v7 08/11] x86, kvm/x86.c: support vcpu preempted check

2016-11-01 Thread Pan Xinhui
kvm_steal_time ::preempted to indicate that if one vcpu is running or not. Signed-off-by: Pan Xinhui <xinhui@linux.vnet.ibm.com> Acked-by: Paolo Bonzini <pbonz...@redhat.com> --- arch/x86/include/uapi/asm/kvm_para.h | 4 +++- arch/x86/kvm/x86.c | 16 +

[Xen-devel] [PATCH v7 10/11] x86, xen: support vcpu preempted check

2016-11-01 Thread Pan Xinhui
early yielding. A quick test (4 vcpus on 1 physical cpu doing a parallel build job with "make -j 8") reduced system time by about 5% with this patch. Signed-off-by: Juergen Gross <jgr...@suse.com> Signed-off-by: Pan Xinhui <xinhui@linux.vnet.ibm.com> --- arch/x86/xe

Re: [Xen-devel] [PATCH v6 10/11] x86, xen: support vcpu preempted check

2016-10-28 Thread Pan Xinhui
在 2016/10/29 03:43, Konrad Rzeszutek Wilk 写道: On Fri, Oct 28, 2016 at 04:11:26AM -0400, Pan Xinhui wrote: From: Juergen Gross <jgr...@suse.com> Support the vcpu_is_preempted() functionality under Xen. This will enhance lock performance on overcommitted hosts (more runnable vcpu

Re: [Xen-devel] [PATCH v6 00/11] implement vcpu preempted check

2016-10-28 Thread Pan Xinhui
在 2016/10/29 03:38, Konrad Rzeszutek Wilk 写道: On Fri, Oct 28, 2016 at 04:11:16AM -0400, Pan Xinhui wrote: change from v5: spilt x86/kvm patch into guest/host part. introduce kvm_write_guest_offset_cached. fix some typos. rebase patch onto 4.9.2 change from v4