回复: [PATCH] gpu: drm: use struct_size() in kmalloc()

2019-05-20 Thread Pan, Xinhui
发送时间: 2019年5月21日 0:28 收件人: Pan, Xinhui 抄送: Deucher, Alexander; Koenig, Christian; Zhou, David(ChunMing); airl...@linux.ie; dan...@ffwll.ch; Quan, Evan; xiaolinkui; amd-...@lists.freedesktop.org; dri-de...@lists.freedesktop.org; linux-kernel@vger.kernel.org 主题: Re: [PATCH] gpu: drm: use

Re: [PATCH v5] locking/pvqspinlock: Relax cmpxchg's to improve performance on some archs

2017-02-27 Thread Pan Xinhui
--- --- 4 4053.3 Mop/s 4223.7 Mop/s +4.2% 8 3310.4 Mop/s 3406.0 Mop/s +2.9% 12 2576.4 Mop/s 2674.6 Mop/s +3.8% Signed-off-by: Waiman Long <long...@redhat.com> --- Works on my side :) Reviewed-by: Pan Xinhui <xinhui@linux.vnet.ibm.c

Re: [PATCH v5] locking/pvqspinlock: Relax cmpxchg's to improve performance on some archs

2017-02-27 Thread Pan Xinhui
--- --- 4 4053.3 Mop/s 4223.7 Mop/s +4.2% 8 3310.4 Mop/s 3406.0 Mop/s +2.9% 12 2576.4 Mop/s 2674.6 Mop/s +3.8% Signed-off-by: Waiman Long --- Works on my side :) Reviewed-by: Pan Xinhui v4->v5: - Correct some grammatical iss

Re: [PATCH] powerpc/xmon: Fix an unexpected xmon onoff state change

2017-02-17 Thread Pan Xinhui
在 2017/2/17 14:05, Michael Ellerman 写道: Pan Xinhui <xin...@linux.vnet.ibm.com> writes: diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c index 9c0e17c..f6e5c3d 100644 --- a/arch/powerpc/xmon/xmon.c +++ b/arch/powerpc/xmon/xmon.c @@ -76,6 +76,7 @@ static int xmon_gate;

Re: [PATCH] powerpc/xmon: Fix an unexpected xmon onoff state change

2017-02-17 Thread Pan Xinhui
在 2017/2/17 14:05, Michael Ellerman 写道: Pan Xinhui writes: diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c index 9c0e17c..f6e5c3d 100644 --- a/arch/powerpc/xmon/xmon.c +++ b/arch/powerpc/xmon/xmon.c @@ -76,6 +76,7 @@ static int xmon_gate; #endif /* CONFIG_SMP */ static

Re: [PATCH] powerpc/xmon: Fix an unexpected xmon onoff state change

2017-02-16 Thread Pan Xinhui
在 2017/2/16 18:57, Guilherme G. Piccoli 写道: On 16/02/2017 03:09, Michael Ellerman wrote: Pan Xinhui <xinhui@linux.vnet.ibm.com> writes: Once xmon is triggered by sysrq-x, it is enabled always afterwards even if it is disabled during boot. This will cause a system reset interru

Re: [PATCH] powerpc/xmon: Fix an unexpected xmon onoff state change

2017-02-16 Thread Pan Xinhui
在 2017/2/16 18:57, Guilherme G. Piccoli 写道: On 16/02/2017 03:09, Michael Ellerman wrote: Pan Xinhui writes: Once xmon is triggered by sysrq-x, it is enabled always afterwards even if it is disabled during boot. This will cause a system reset interrut fail to dump. So keep xmon in its

[PATCH] powerpc/xmon: Fix an unexpected xmon onoff state change

2017-02-14 Thread Pan Xinhui
Once xmon is triggered by sysrq-x, it is enabled always afterwards even if it is disabled during boot. This will cause a system reset interrut fail to dump. So keep xmon in its original state after exit. Signed-off-by: Pan Xinhui <xinhui@linux.vnet.ibm.com> --- arch/powerpc/xmon/xmon

[PATCH] powerpc/xmon: Fix an unexpected xmon onoff state change

2017-02-14 Thread Pan Xinhui
Once xmon is triggered by sysrq-x, it is enabled always afterwards even if it is disabled during boot. This will cause a system reset interrut fail to dump. So keep xmon in its original state after exit. Signed-off-by: Pan Xinhui --- arch/powerpc/xmon/xmon.c | 5 - 1 file changed, 4

[PATCH] powerpc/xmon: add turn off xmon option

2017-02-12 Thread Pan Xinhui
commands. Turn xmon off if 'z' is following. Signed-off-by: Pan Xinhui <xinhui@linux.vnet.ibm.com> --- arch/powerpc/xmon/xmon.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c index 9c0e17c..2f4e7b1

[PATCH] powerpc/xmon: add turn off xmon option

2017-02-12 Thread Pan Xinhui
commands. Turn xmon off if 'z' is following. Signed-off-by: Pan Xinhui --- arch/powerpc/xmon/xmon.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c index 9c0e17c..2f4e7b1 100644 --- a/arch/powerpc/xmon/xmon.c

Re: [PATCH v2] locking/pvqspinlock: Relax cmpxchg's to improve performance on some archs

2017-02-07 Thread Pan Xinhui
在 2017/2/8 14:09, Boqun Feng 写道: On Wed, Feb 08, 2017 at 12:05:40PM +0800, Boqun Feng wrote: On Wed, Feb 08, 2017 at 11:39:10AM +0800, Xinhui Pan wrote: 2016-12-26 4:26 GMT+08:00 Waiman Long : A number of cmpxchg calls in qspinlock_paravirt.h were replaced by more

Re: [PATCH v2] locking/pvqspinlock: Relax cmpxchg's to improve performance on some archs

2017-02-07 Thread Pan Xinhui
在 2017/2/8 14:09, Boqun Feng 写道: On Wed, Feb 08, 2017 at 12:05:40PM +0800, Boqun Feng wrote: On Wed, Feb 08, 2017 at 11:39:10AM +0800, Xinhui Pan wrote: 2016-12-26 4:26 GMT+08:00 Waiman Long : A number of cmpxchg calls in qspinlock_paravirt.h were replaced by more relaxed versions to

Re: [PATCH v2] locking/pvqspinlock: Relax cmpxchg's to improve performance on some archs

2017-02-07 Thread Pan Xinhui
在 2017/2/8 14:09, Boqun Feng 写道: On Wed, Feb 08, 2017 at 12:05:40PM +0800, Boqun Feng wrote: On Wed, Feb 08, 2017 at 11:39:10AM +0800, Xinhui Pan wrote: 2016-12-26 4:26 GMT+08:00 Waiman Long : A number of cmpxchg calls in qspinlock_paravirt.h were replaced by more

Re: [PATCH v2] locking/pvqspinlock: Relax cmpxchg's to improve performance on some archs

2017-02-07 Thread Pan Xinhui
在 2017/2/8 14:09, Boqun Feng 写道: On Wed, Feb 08, 2017 at 12:05:40PM +0800, Boqun Feng wrote: On Wed, Feb 08, 2017 at 11:39:10AM +0800, Xinhui Pan wrote: 2016-12-26 4:26 GMT+08:00 Waiman Long : A number of cmpxchg calls in qspinlock_paravirt.h were replaced by more relaxed versions to

Re: [PATCH v2] locking/pvqspinlock: Relax cmpxchg's to improve performance on some archs

2017-02-07 Thread Pan Xinhui
在 2017/2/8 14:09, Boqun Feng 写道: On Wed, Feb 08, 2017 at 12:05:40PM +0800, Boqun Feng wrote: On Wed, Feb 08, 2017 at 11:39:10AM +0800, Xinhui Pan wrote: 2016-12-26 4:26 GMT+08:00 Waiman Long : A number of cmpxchg calls in qspinlock_paravirt.h were replaced by more

Re: [PATCH v2] locking/pvqspinlock: Relax cmpxchg's to improve performance on some archs

2017-02-07 Thread Pan Xinhui
在 2017/2/8 14:09, Boqun Feng 写道: On Wed, Feb 08, 2017 at 12:05:40PM +0800, Boqun Feng wrote: On Wed, Feb 08, 2017 at 11:39:10AM +0800, Xinhui Pan wrote: 2016-12-26 4:26 GMT+08:00 Waiman Long : A number of cmpxchg calls in qspinlock_paravirt.h were replaced by more relaxed versions to

[tip:locking/core] locking/pvqspinlock: Don't wait if vCPU is preempted

2017-01-12 Thread tip-bot for Pan Xinhui
Commit-ID: 75437bb304b20a2b350b9a8e9f9238d5e24e12ba Gitweb: http://git.kernel.org/tip/75437bb304b20a2b350b9a8e9f9238d5e24e12ba Author: Pan Xinhui <xinhui@linux.vnet.ibm.com> AuthorDate: Tue, 10 Jan 2017 02:56:46 -0500 Committer: Ingo Molnar <mi...@kernel.org> CommitDate:

[tip:locking/core] locking/pvqspinlock: Don't wait if vCPU is preempted

2017-01-12 Thread tip-bot for Pan Xinhui
Commit-ID: 75437bb304b20a2b350b9a8e9f9238d5e24e12ba Gitweb: http://git.kernel.org/tip/75437bb304b20a2b350b9a8e9f9238d5e24e12ba Author: Pan Xinhui AuthorDate: Tue, 10 Jan 2017 02:56:46 -0500 Committer: Ingo Molnar CommitDate: Thu, 12 Jan 2017 09:35:57 +0100 locking/pvqspinlock: Don't

[PATCH v2] locking/pvqspinlock: Wait early if vCPU is preempted

2017-01-09 Thread Pan Xinhui
If prev node is not in runnig state or its vCPU is preempted, we can give up our vCPU slices ASAP in pv_wait_node. After commit d9345c65eb79 ("sched/core: Introduce the vcpu_is_preempted(cpu) interface") kernel has knowledge of one vCPU is running or not. Signed-off-by: Pan Xinh

[PATCH v2] locking/pvqspinlock: Wait early if vCPU is preempted

2017-01-09 Thread Pan Xinhui
If prev node is not in runnig state or its vCPU is preempted, we can give up our vCPU slices ASAP in pv_wait_node. After commit d9345c65eb79 ("sched/core: Introduce the vcpu_is_preempted(cpu) interface") kernel has knowledge of one vCPU is running or not. Signed-off-by: Pan Xinh

Re: [PATCH v2] locking/pvqspinlock: Relax cmpxchg's to improve performance on some archs

2017-01-05 Thread Pan Xinhui
在 2017/1/4 17:41, Peter Zijlstra 写道: On Tue, Jan 03, 2017 at 05:07:54PM -0500, Waiman Long wrote: On 01/03/2017 11:18 AM, Peter Zijlstra wrote: On Sun, Dec 25, 2016 at 03:26:01PM -0500, Waiman Long wrote: A number of cmpxchg calls in qspinlock_paravirt.h were replaced by more relaxed

Re: [PATCH v2] locking/pvqspinlock: Relax cmpxchg's to improve performance on some archs

2017-01-05 Thread Pan Xinhui
在 2017/1/4 17:41, Peter Zijlstra 写道: On Tue, Jan 03, 2017 at 05:07:54PM -0500, Waiman Long wrote: On 01/03/2017 11:18 AM, Peter Zijlstra wrote: On Sun, Dec 25, 2016 at 03:26:01PM -0500, Waiman Long wrote: A number of cmpxchg calls in qspinlock_paravirt.h were replaced by more relaxed

Re: [PATCH] locking/pvqspinlock: Wait early if vcpu is preempted

2017-01-05 Thread Pan Xinhui
在 2017/1/5 16:23, Ingo Molnar 写道: * Pan Xinhui <xinhui@linux.vnet.ibm.com> wrote: If prev node is not in runnig state or its cpu is preempted, we need wait early in pv_wait_node. After commit "sched/core: Introduce the vcpu_is_preempted(cpu) interface" kernel has knowl

Re: [PATCH] locking/pvqspinlock: Wait early if vcpu is preempted

2017-01-05 Thread Pan Xinhui
在 2017/1/5 16:23, Ingo Molnar 写道: * Pan Xinhui wrote: If prev node is not in runnig state or its cpu is preempted, we need wait early in pv_wait_node. After commit "sched/core: Introduce the vcpu_is_preempted(cpu) interface" kernel has knowledge of one vcpu is running or not. S

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

2016-12-19 Thread Pan Xinhui
hi, Andrea thanks for your reply. :) 在 2016/12/19 19:42, Andrea Arcangeli 写道: Hello, On Wed, Nov 02, 2016 at 05:08:35AM -0400, Pan Xinhui wrote: Support the vcpu_is_preempted() functionality under KVM. This will enhance lock performance on overcommitted hosts (more runnable vcpus than

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

2016-12-19 Thread Pan Xinhui
hi, Andrea thanks for your reply. :) 在 2016/12/19 19:42, Andrea Arcangeli 写道: Hello, On Wed, Nov 02, 2016 at 05:08:35AM -0400, Pan Xinhui wrote: Support the vcpu_is_preempted() functionality under KVM. This will enhance lock performance on overcommitted hosts (more runnable vcpus than

Re: [GIT PULL] KVM fixes for 4.10 merge window

2016-12-16 Thread Pan Xinhui
ks xinhui - From d4fa3ea0b8b6f3e5ff511604a4a6665d1cbb74c3 Mon Sep 17 00:00:00 2001 From: Pan Xinhui <xinhui@linux.vnet.ibm.com> Date: Sat, 17 Dec 2016 02:56:33 -0500 Subject: [PATCH] kvm: fix compile issue we revert commit 0b9f6c4615c993d2b552e0d2bd1ade49b56e5beb which calls sleep

Re: [GIT PULL] KVM fixes for 4.10 merge window

2016-12-16 Thread Pan Xinhui
rom d4fa3ea0b8b6f3e5ff511604a4a6665d1cbb74c3 Mon Sep 17 00:00:00 2001 From: Pan Xinhui Date: Sat, 17 Dec 2016 02:56:33 -0500 Subject: [PATCH] kvm: fix compile issue we revert commit 0b9f6c4615c993d2b552e0d2bd1ade49b56e5beb which calls sleep function while preempt_disable on host part. But we remove str

Re: [PATCH v5 1/2] sysctl: introduce new proc handler proc_dobool

2016-12-15 Thread Pan Xinhui
在 2016/12/15 15:24, Jia He 写道: This is to let bool variable could be correctly displayed in big/little endian sysctl procfs. sizeof(bool) is arch dependent, proc_dobool should work in all arches. Suggested-by: Pan Xinhui <xin...@linux.vnet.ibm.com> Signed-off-by: Jia He <hejia...@

Re: [PATCH v5 1/2] sysctl: introduce new proc handler proc_dobool

2016-12-15 Thread Pan Xinhui
在 2016/12/15 15:24, Jia He 写道: This is to let bool variable could be correctly displayed in big/little endian sysctl procfs. sizeof(bool) is arch dependent, proc_dobool should work in all arches. Suggested-by: Pan Xinhui Signed-off-by: Jia He --- include/linux/sysctl.h | 2 ++ kernel

Re: [PATCH v5 2/2] lockd: change the proc_handler for nsm_use_hostnames

2016-12-15 Thread Pan Xinhui
for me. Reviewed-by: Pan Xinhui <xinhui@linux.vnet.ibm.com> fs/lockd/svc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/lockd/svc.c b/fs/lockd/svc.c index fc4084e..bd6fcf9 100644 --- a/fs/lockd/svc.c +++ b/fs/lockd/svc.c @@ -561,7 +561,7 @@ static struct ctl_table

Re: [PATCH v5 2/2] lockd: change the proc_handler for nsm_use_hostnames

2016-12-15 Thread Pan Xinhui
endian system, the converting from/to bool to/from int will cause error for proc items. This patch use a new proc_handler proc_dobool to fixe it. ^^^fix^^^ Signed-off-by: Jia He --- other than that is okay for me. Reviewed-by: Pan Xinhui

Re: [PATCH v2 1/1] lockd: Change nsm_use_hostnames from bool to u32

2016-12-11 Thread Pan Xinhui
在 2016/12/12 01:43, Pan Xinhui 写道: hi, jia nice catch! However I think we should fix it totally. This is because do_proc_dointvec_conv() try to get a int value from a bool *. something like below might help. pls. ignore the code style and this is tested

Re: [PATCH v2 1/1] lockd: Change nsm_use_hostnames from bool to u32

2016-12-11 Thread Pan Xinhui
在 2016/12/12 01:43, Pan Xinhui 写道: hi, jia nice catch! However I think we should fix it totally. This is because do_proc_dointvec_conv() try to get a int value from a bool *. something like below might help. pls. ignore the code style and this is tested

Re: [PATCH v2 0/1] lockd: Change nsm_use_hostnames from bool to u32

2016-12-11 Thread Pan Xinhui
在 2016/12/11 23:36, Jia He 写道: nsm_use_hostnames is a module parameter and it will be exported to sysctl procfs. This is to let user sometimes change it from userspace. But the minimal unit for sysctl procfs read/write it sizeof(int). In big endian system, the converting from/to bool to/from

Re: [PATCH v2 0/1] lockd: Change nsm_use_hostnames from bool to u32

2016-12-11 Thread Pan Xinhui
在 2016/12/11 23:36, Jia He 写道: nsm_use_hostnames is a module parameter and it will be exported to sysctl procfs. This is to let user sometimes change it from userspace. But the minimal unit for sysctl procfs read/write it sizeof(int). In big endian system, the converting from/to bool to/from

Re: [PATCH v2 1/1] lockd: Change nsm_use_hostnames from bool to u32

2016-12-11 Thread Pan Xinhui
hi, jia nice catch! However I think we should fix it totally. This is because do_proc_dointvec_conv() try to get a int value from a bool *. something like below might help. pls. ignore the code style and this is tested :) diff --git a/fs/lockd/svc.c b/fs/lockd/svc.c index

Re: [PATCH v2 1/1] lockd: Change nsm_use_hostnames from bool to u32

2016-12-11 Thread Pan Xinhui
hi, jia nice catch! However I think we should fix it totally. This is because do_proc_dointvec_conv() try to get a int value from a bool *. something like below might help. pls. ignore the code style and this is tested :) diff --git a/fs/lockd/svc.c b/fs/lockd/svc.c index

Re: [PATCH 2/2] x86, paravirt: Fix bool return type for PVOP_CALL

2016-12-08 Thread Pan Xinhui
hi, Peter I think I know the point. then could we just let __eax rettype(here is bool), not unsigned long? I does not do tests for my thoughts. @@ -461,7 +461,9 @@ int paravirt_disable_iospace(void); #define PVOP_VCALL_ARGS \

Re: [PATCH 2/2] x86, paravirt: Fix bool return type for PVOP_CALL

2016-12-08 Thread Pan Xinhui
hi, Peter I think I know the point. then could we just let __eax rettype(here is bool), not unsigned long? I does not do tests for my thoughts. @@ -461,7 +461,9 @@ int paravirt_disable_iospace(void); #define PVOP_VCALL_ARGS \

Re: [PATCH-tip] locking/pvqspinlock: Relax cmpxchg's to improve performance on some archs

2016-12-07 Thread Pan Xinhui
在 2016/12/7 03:14, Waiman Long 写道: A number of cmpxchg calls in qspinlock_paravirt.h were replaced by more relaxed versions to improve performance on architectures that use LL/SC. Signed-off-by: Waiman Long --- thanks! I apply it on my tree. and the tests is okay. ke

Re: [PATCH-tip] locking/pvqspinlock: Relax cmpxchg's to improve performance on some archs

2016-12-07 Thread Pan Xinhui
在 2016/12/7 03:14, Waiman Long 写道: A number of cmpxchg calls in qspinlock_paravirt.h were replaced by more relaxed versions to improve performance on architectures that use LL/SC. Signed-off-by: Waiman Long --- thanks! I apply it on my tree. and the tests is okay. ke

[PATCH] locking/pvqspinlock: Wait early if vcpu is preempted

2016-12-06 Thread Pan Xinhui
If prev node is not in runnig state or its cpu is preempted, we need wait early in pv_wait_node. After commit "sched/core: Introduce the vcpu_is_preempted(cpu) interface" kernel has knowledge of one vcpu is running or not. So lets use it. Signed-off-by: Pan Xinhui <xinhui@linux

[PATCH] locking/pvqspinlock: Wait early if vcpu is preempted

2016-12-06 Thread Pan Xinhui
If prev node is not in runnig state or its cpu is preempted, we need wait early in pv_wait_node. After commit "sched/core: Introduce the vcpu_is_preempted(cpu) interface" kernel has knowledge of one vcpu is running or not. So lets use it. Signed-off-by: Pan Xinhui --- kern

[PATCH v9 4/6] powerpc/pv-qspinlock: powerpc support pv-qspinlock

2016-12-06 Thread Pan Xinhui
in the hash table might not be the correct lock holder, as for performace issue, we does not take care of hash conflict. Also introduce spin_lock_holder, which tells who owns the lock now. currently the only user is spin_unlock_wait. Signed-off-by: Pan Xinhui <xinhui@linux.vnet.ibm.

[PATCH v9 4/6] powerpc/pv-qspinlock: powerpc support pv-qspinlock

2016-12-06 Thread Pan Xinhui
in the hash table might not be the correct lock holder, as for performace issue, we does not take care of hash conflict. Also introduce spin_lock_holder, which tells who owns the lock now. currently the only user is spin_unlock_wait. Signed-off-by: Pan Xinhui --- arch/powerpc/include/asm

[PATCH v9 0/6] Implement qspinlock/pv-qspinlock on ppc

2016-12-06 Thread Pan Xinhui
1050.6 ---- Pan Xinhui (6): powerpc/qspinlock: powerpc support qspinlock powerpc: platforms/Kconfig: Add qspinlock build config powerpc: lib/locks.c: Add cpu yield/wake helper function powerpc/pv-qspinlock: powerpc support pv-qspinlo

[PATCH v9 6/6] powerpc/pv-qspinlock: Optimise native unlock path

2016-12-06 Thread Pan Xinhui
Avoid a function call under native version of qspinlock. On powerNV, bafore applying this patch, every unlock is expensive. This small optimizes enhance the performance. We use static_key with jump_lable which removes unnecessary loads of lppaca and its stuff. Signed-off-by: Pan Xinhui <xin

[PATCH v9 0/6] Implement qspinlock/pv-qspinlock on ppc

2016-12-06 Thread Pan Xinhui
1050.6 ---- Pan Xinhui (6): powerpc/qspinlock: powerpc support qspinlock powerpc: platforms/Kconfig: Add qspinlock build config powerpc: lib/locks.c: Add cpu yield/wake helper function powerpc/pv-qspinlock: powerpc support pv-qspinlo

[PATCH v9 6/6] powerpc/pv-qspinlock: Optimise native unlock path

2016-12-06 Thread Pan Xinhui
Avoid a function call under native version of qspinlock. On powerNV, bafore applying this patch, every unlock is expensive. This small optimizes enhance the performance. We use static_key with jump_lable which removes unnecessary loads of lppaca and its stuff. Signed-off-by: Pan Xinhui

[PATCH v9 5/6] powerpc: pSeries: Add pv-qspinlock build config/make

2016-12-06 Thread Pan Xinhui
pSeries run as a guest and might need pv-qspinlock. Signed-off-by: Pan Xinhui <xinhui@linux.vnet.ibm.com> --- arch/powerpc/kernel/Makefile | 1 + arch/powerpc/platforms/pseries/Kconfig | 8 2 files changed, 9 insertions(+) diff --git a/arch/powerpc/kernel/Makefile

[PATCH v9 5/6] powerpc: pSeries: Add pv-qspinlock build config/make

2016-12-06 Thread Pan Xinhui
pSeries run as a guest and might need pv-qspinlock. Signed-off-by: Pan Xinhui --- arch/powerpc/kernel/Makefile | 1 + arch/powerpc/platforms/pseries/Kconfig | 8 2 files changed, 9 insertions(+) diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile index

[PATCH v9 1/6] powerpc/qspinlock: powerpc support qspinlock

2016-12-06 Thread Pan Xinhui
endianness system. We override some arch_spin_XXX as powerpc has io_sync stuff which makes sure the io operations are protected by the lock correctly. There is another special case, see commit 2c610022711 ("locking/qspinlock: Fix spin_unlock_wait() some more") Signed-off-by: Pan Xinh

[PATCH v9 1/6] powerpc/qspinlock: powerpc support qspinlock

2016-12-06 Thread Pan Xinhui
endianness system. We override some arch_spin_XXX as powerpc has io_sync stuff which makes sure the io operations are protected by the lock correctly. There is another special case, see commit 2c610022711 ("locking/qspinlock: Fix spin_unlock_wait() some more") Signed-off-by: Pan Xinhui

[PATCH v9 2/6] powerpc: platforms/Kconfig: Add qspinlock build config

2016-12-06 Thread Pan Xinhui
pSeries/powerNV will use qspinlock from now on. Signed-off-by: Pan Xinhui <xinhui@linux.vnet.ibm.com> --- arch/powerpc/platforms/Kconfig | 9 + 1 file changed, 9 insertions(+) diff --git a/arch/powerpc/platforms/Kconfig b/arch/powerpc/platforms/Kconfig index fbdae83..3559bbf

[PATCH v9 3/6] powerpc: lib/locks.c: Add cpu yield/wake helper function

2016-12-06 Thread Pan Xinhui
will introduce latency and a little overhead. And we do NOT want to suffer any latency on some cases, e.g. in interrupt handler. The second parameter *confer* can indicate such case. __spin_wake_cpu is simpiler, it will wake up one vcpu regardless of its current vcpu state. Signed-off-by: Pan

[PATCH v9 2/6] powerpc: platforms/Kconfig: Add qspinlock build config

2016-12-06 Thread Pan Xinhui
pSeries/powerNV will use qspinlock from now on. Signed-off-by: Pan Xinhui --- arch/powerpc/platforms/Kconfig | 9 + 1 file changed, 9 insertions(+) diff --git a/arch/powerpc/platforms/Kconfig b/arch/powerpc/platforms/Kconfig index fbdae83..3559bbf 100644 --- a/arch/powerpc/platforms

[PATCH v9 3/6] powerpc: lib/locks.c: Add cpu yield/wake helper function

2016-12-06 Thread Pan Xinhui
will introduce latency and a little overhead. And we do NOT want to suffer any latency on some cases, e.g. in interrupt handler. The second parameter *confer* can indicate such case. __spin_wake_cpu is simpiler, it will wake up one vcpu regardless of its current vcpu state. Signed-off-by: Pan

Re: [PATCH v8 2/6] powerpc: pSeries/Kconfig: Add qspinlock build config

2016-12-05 Thread Pan Xinhui
在 2016/12/6 09:24, Pan Xinhui 写道: 在 2016/12/6 08:58, Boqun Feng 写道: On Mon, Dec 05, 2016 at 10:19:22AM -0500, Pan Xinhui wrote: pSeries/powerNV will use qspinlock from now on. Signed-off-by: Pan Xinhui <xinhui@linux.vnet.ibm.com> --- arch/powerpc/platforms/pseries/Kconf

Re: [PATCH v8 2/6] powerpc: pSeries/Kconfig: Add qspinlock build config

2016-12-05 Thread Pan Xinhui
在 2016/12/6 09:24, Pan Xinhui 写道: 在 2016/12/6 08:58, Boqun Feng 写道: On Mon, Dec 05, 2016 at 10:19:22AM -0500, Pan Xinhui wrote: pSeries/powerNV will use qspinlock from now on. Signed-off-by: Pan Xinhui --- arch/powerpc/platforms/pseries/Kconfig | 8 1 file changed, 8 insertions

Re: [PATCH v8 2/6] powerpc: pSeries/Kconfig: Add qspinlock build config

2016-12-05 Thread Pan Xinhui
在 2016/12/6 08:58, Boqun Feng 写道: On Mon, Dec 05, 2016 at 10:19:22AM -0500, Pan Xinhui wrote: pSeries/powerNV will use qspinlock from now on. Signed-off-by: Pan Xinhui <xinhui@linux.vnet.ibm.com> --- arch/powerpc/platforms/pseries/Kconfig | 8 1 file changed, 8 inse

Re: [PATCH v8 2/6] powerpc: pSeries/Kconfig: Add qspinlock build config

2016-12-05 Thread Pan Xinhui
在 2016/12/6 08:58, Boqun Feng 写道: On Mon, Dec 05, 2016 at 10:19:22AM -0500, Pan Xinhui wrote: pSeries/powerNV will use qspinlock from now on. Signed-off-by: Pan Xinhui --- arch/powerpc/platforms/pseries/Kconfig | 8 1 file changed, 8 insertions(+) diff --git a/arch/powerpc

Re: [PATCH v8 1/6] powerpc/qspinlock: powerpc support qspinlock

2016-12-05 Thread Pan Xinhui
correct waiman's address. 在 2016/12/6 08:47, Boqun Feng 写道: On Mon, Dec 05, 2016 at 10:19:21AM -0500, Pan Xinhui wrote: This patch add basic code to enable qspinlock on powerpc. qspinlock is one kind of fairlock implementation. And seen some performance improvement under some scenarios

Re: [PATCH v8 1/6] powerpc/qspinlock: powerpc support qspinlock

2016-12-05 Thread Pan Xinhui
correct waiman's address. 在 2016/12/6 08:47, Boqun Feng 写道: On Mon, Dec 05, 2016 at 10:19:21AM -0500, Pan Xinhui wrote: This patch add basic code to enable qspinlock on powerpc. qspinlock is one kind of fairlock implementation. And seen some performance improvement under some scenarios

[PATCH v8 1/6] powerpc/qspinlock: powerpc support qspinlock

2016-12-05 Thread Pan Xinhui
endianness system. We override some arch_spin_XXX as powerpc has io_sync stuff which makes sure the io operations are protected by the lock correctly. There is another special case, see commit 2c610022711 ("locking/qspinlock: Fix spin_unlock_wait() some more") Signed-off-by: Pan Xinh

[PATCH v8 1/6] powerpc/qspinlock: powerpc support qspinlock

2016-12-05 Thread Pan Xinhui
endianness system. We override some arch_spin_XXX as powerpc has io_sync stuff which makes sure the io operations are protected by the lock correctly. There is another special case, see commit 2c610022711 ("locking/qspinlock: Fix spin_unlock_wait() some more") Signed-off-by: Pan Xinhui

[PATCH v8 2/6] powerpc: pSeries/Kconfig: Add qspinlock build config

2016-12-05 Thread Pan Xinhui
pSeries/powerNV will use qspinlock from now on. Signed-off-by: Pan Xinhui <xinhui@linux.vnet.ibm.com> --- arch/powerpc/platforms/pseries/Kconfig | 8 1 file changed, 8 insertions(+) diff --git a/arch/powerpc/platforms/pseries/Kconfig b/arch/powerpc/platforms/pseries/Kconfig

[PATCH v8 2/6] powerpc: pSeries/Kconfig: Add qspinlock build config

2016-12-05 Thread Pan Xinhui
pSeries/powerNV will use qspinlock from now on. Signed-off-by: Pan Xinhui --- arch/powerpc/platforms/pseries/Kconfig | 8 1 file changed, 8 insertions(+) diff --git a/arch/powerpc/platforms/pseries/Kconfig b/arch/powerpc/platforms/pseries/Kconfig index bec90fb..8a87d06 100644

[PATCH v8 4/6] powerpc/pv-qspinlock: powerpc support pv-qspinlock

2016-12-05 Thread Pan Xinhui
in the hash table might not be the correct lock holder, as for performace issue, we does not take care of hash conflict. Also introduce spin_lock_holder, which tells who owns the lock now. currently the only user is spin_unlock_wait. Signed-off-by: Pan Xinhui <xinhui@linux.vnet.ibm.

[PATCH v8 4/6] powerpc/pv-qspinlock: powerpc support pv-qspinlock

2016-12-05 Thread Pan Xinhui
in the hash table might not be the correct lock holder, as for performace issue, we does not take care of hash conflict. Also introduce spin_lock_holder, which tells who owns the lock now. currently the only user is spin_unlock_wait. Signed-off-by: Pan Xinhui --- arch/powerpc/include/asm

[PATCH v8 6/6] powerpc/pv-qspinlock: Optimise native unlock path

2016-12-05 Thread Pan Xinhui
Avoid a function call under native version of qspinlock. On powerNV, bafore applying this patch, every unlock is expensive. This small optimizes enhance the performance. We use static_key with jump_label which removes unnecessary loads of lppaca and its stuff. Signed-off-by: Pan Xinhui <xin

[PATCH v8 0/6] Implement qspinlock/pv-qspinlock on ppc

2016-12-05 Thread Pan Xinhui
1134.2 = System Benchmarks Index Score 1072.0 1108.91050.6 -------- Pan Xinhui (6): powerpc/qspinlock: powerpc support qspinlock powerpc

[PATCH v8 5/6] powerpc: pSeries: Add pv-qspinlock build config/make

2016-12-05 Thread Pan Xinhui
pSeries run as a guest and might need pv-qspinlock. Signed-off-by: Pan Xinhui <xinhui@linux.vnet.ibm.com> --- arch/powerpc/kernel/Makefile | 1 + arch/powerpc/platforms/pseries/Kconfig | 8 2 files changed, 9 insertions(+) diff --git a/arch/powerpc/kernel/Makefile

[PATCH v8 3/6] powerpc: lib/locks.c: Add cpu yield/wake helper function

2016-12-05 Thread Pan Xinhui
will introduce latency and a little overhead. And we do NOT want to suffer any latency on some cases, e.g. in interrupt handler. The second parameter *confer* can indicate such case. __spin_wake_cpu is simpiler, it will wake up one vcpu regardless of its current vcpu state. Signed-off-by: Pan

[PATCH v8 6/6] powerpc/pv-qspinlock: Optimise native unlock path

2016-12-05 Thread Pan Xinhui
Avoid a function call under native version of qspinlock. On powerNV, bafore applying this patch, every unlock is expensive. This small optimizes enhance the performance. We use static_key with jump_label which removes unnecessary loads of lppaca and its stuff. Signed-off-by: Pan Xinhui

[PATCH v8 0/6] Implement qspinlock/pv-qspinlock on ppc

2016-12-05 Thread Pan Xinhui
1134.2 = System Benchmarks Index Score 1072.0 1108.91050.6 -------- Pan Xinhui (6): powerpc/qspinlock: powerpc support qspinlock powerpc

[PATCH v8 5/6] powerpc: pSeries: Add pv-qspinlock build config/make

2016-12-05 Thread Pan Xinhui
pSeries run as a guest and might need pv-qspinlock. Signed-off-by: Pan Xinhui --- arch/powerpc/kernel/Makefile | 1 + arch/powerpc/platforms/pseries/Kconfig | 8 2 files changed, 9 insertions(+) diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile index

[PATCH v8 3/6] powerpc: lib/locks.c: Add cpu yield/wake helper function

2016-12-05 Thread Pan Xinhui
will introduce latency and a little overhead. And we do NOT want to suffer any latency on some cases, e.g. in interrupt handler. The second parameter *confer* can indicate such case. __spin_wake_cpu is simpiler, it will wake up one vcpu regardless of its current vcpu state. Signed-off-by: Pan

Re: [PATCH] powerpc: cputime: fix a compile warning

2016-12-01 Thread Pan Xinhui
在 2016/12/2 12:35, yjin 写道: On 2016年12月02日 12:22, Balbir Singh wrote: On Fri, Dec 2, 2016 at 3:15 PM, Michael Ellerman wrote: yanjiang@windriver.com writes: diff --git a/arch/powerpc/include/asm/cputime.h b/arch/powerpc/include/asm/cputime.h index

Re: [PATCH] powerpc: cputime: fix a compile warning

2016-12-01 Thread Pan Xinhui
在 2016/12/2 12:35, yjin 写道: On 2016年12月02日 12:22, Balbir Singh wrote: On Fri, Dec 2, 2016 at 3:15 PM, Michael Ellerman wrote: yanjiang@windriver.com writes: diff --git a/arch/powerpc/include/asm/cputime.h b/arch/powerpc/include/asm/cputime.h index 4f60db0..4423e97 100644 ---

[tip:locking/core] x86/kvm: Support the vCPU preemption check

2016-11-22 Thread tip-bot for Pan Xinhui
Commit-ID: 0b9f6c4615c993d2b552e0d2bd1ade49b56e5beb Gitweb: http://git.kernel.org/tip/0b9f6c4615c993d2b552e0d2bd1ade49b56e5beb Author: Pan Xinhui <xinhui@linux.vnet.ibm.com> AuthorDate: Wed, 2 Nov 2016 05:08:35 -0400 Committer: Ingo Molnar <mi...@kernel.org> CommitDate:

[tip:locking/core] x86/kvm: Support the vCPU preemption check

2016-11-22 Thread tip-bot for Pan Xinhui
Commit-ID: 1885aa7041c9e801e5d5b093b9dad38937ca37f6 Gitweb: http://git.kernel.org/tip/1885aa7041c9e801e5d5b093b9dad38937ca37f6 Author: Pan Xinhui <xinhui@linux.vnet.ibm.com> AuthorDate: Wed, 2 Nov 2016 05:08:36 -0400 Committer: Ingo Molnar <mi...@kernel.org> CommitDate:

[tip:locking/core] locking/mutex: Break out of expensive busy-loop on {mutex,rwsem}_spin_on_owner() when owner vCPU is preempted

2016-11-22 Thread tip-bot for Pan Xinhui
Commit-ID: 05ffc951392df57edecc2519327b169210c3df75 Gitweb: http://git.kernel.org/tip/05ffc951392df57edecc2519327b169210c3df75 Author: Pan Xinhui <xinhui@linux.vnet.ibm.com> AuthorDate: Wed, 2 Nov 2016 05:08:30 -0400 Committer: Ingo Molnar <mi...@kernel.org> CommitDate:

[tip:locking/core] x86/kvm: Support the vCPU preemption check

2016-11-22 Thread tip-bot for Pan Xinhui
Commit-ID: 0b9f6c4615c993d2b552e0d2bd1ade49b56e5beb Gitweb: http://git.kernel.org/tip/0b9f6c4615c993d2b552e0d2bd1ade49b56e5beb Author: Pan Xinhui AuthorDate: Wed, 2 Nov 2016 05:08:35 -0400 Committer: Ingo Molnar CommitDate: Tue, 22 Nov 2016 12:48:08 +0100 x86/kvm: Support the vCPU

[tip:locking/core] x86/kvm: Support the vCPU preemption check

2016-11-22 Thread tip-bot for Pan Xinhui
Commit-ID: 1885aa7041c9e801e5d5b093b9dad38937ca37f6 Gitweb: http://git.kernel.org/tip/1885aa7041c9e801e5d5b093b9dad38937ca37f6 Author: Pan Xinhui AuthorDate: Wed, 2 Nov 2016 05:08:36 -0400 Committer: Ingo Molnar CommitDate: Tue, 22 Nov 2016 12:48:08 +0100 x86/kvm: Support the vCPU

[tip:locking/core] locking/mutex: Break out of expensive busy-loop on {mutex,rwsem}_spin_on_owner() when owner vCPU is preempted

2016-11-22 Thread tip-bot for Pan Xinhui
Commit-ID: 05ffc951392df57edecc2519327b169210c3df75 Gitweb: http://git.kernel.org/tip/05ffc951392df57edecc2519327b169210c3df75 Author: Pan Xinhui AuthorDate: Wed, 2 Nov 2016 05:08:30 -0400 Committer: Ingo Molnar CommitDate: Tue, 22 Nov 2016 12:48:10 +0100 locking/mutex: Break out

[tip:locking/core] Documentation/virtual/kvm: Support the vCPU preemption check

2016-11-22 Thread tip-bot for Pan Xinhui
Commit-ID: 3dd3e0ce7989b645eee0174b17f5095e187c7f28 Gitweb: http://git.kernel.org/tip/3dd3e0ce7989b645eee0174b17f5095e187c7f28 Author: Pan Xinhui <xinhui@linux.vnet.ibm.com> AuthorDate: Wed, 2 Nov 2016 05:08:38 -0400 Committer: Ingo Molnar <mi...@kernel.org> CommitDate:

[tip:locking/core] locking/osq: Break out of spin-wait busy waiting loop for a preempted vCPU in osq_lock()

2016-11-22 Thread tip-bot for Pan Xinhui
Commit-ID: 5aff60a191e579ae00ae5ca6ce16c13b687bc8a3 Gitweb: http://git.kernel.org/tip/5aff60a191e579ae00ae5ca6ce16c13b687bc8a3 Author: Pan Xinhui <xinhui@linux.vnet.ibm.com> AuthorDate: Wed, 2 Nov 2016 05:08:29 -0400 Committer: Ingo Molnar <mi...@kernel.org> CommitDate:

[tip:locking/core] Documentation/virtual/kvm: Support the vCPU preemption check

2016-11-22 Thread tip-bot for Pan Xinhui
Commit-ID: 3dd3e0ce7989b645eee0174b17f5095e187c7f28 Gitweb: http://git.kernel.org/tip/3dd3e0ce7989b645eee0174b17f5095e187c7f28 Author: Pan Xinhui AuthorDate: Wed, 2 Nov 2016 05:08:38 -0400 Committer: Ingo Molnar CommitDate: Tue, 22 Nov 2016 12:48:09 +0100 Documentation/virtual/kvm

[tip:locking/core] locking/osq: Break out of spin-wait busy waiting loop for a preempted vCPU in osq_lock()

2016-11-22 Thread tip-bot for Pan Xinhui
Commit-ID: 5aff60a191e579ae00ae5ca6ce16c13b687bc8a3 Gitweb: http://git.kernel.org/tip/5aff60a191e579ae00ae5ca6ce16c13b687bc8a3 Author: Pan Xinhui AuthorDate: Wed, 2 Nov 2016 05:08:29 -0400 Committer: Ingo Molnar CommitDate: Tue, 22 Nov 2016 12:48:10 +0100 locking/osq: Break out

[tip:locking/core] kvm: Introduce kvm_write_guest_offset_cached()

2016-11-22 Thread tip-bot for Pan Xinhui
Commit-ID: 4ec6e863625625a54f527464ab91ce1a1cb16c42 Gitweb: http://git.kernel.org/tip/4ec6e863625625a54f527464ab91ce1a1cb16c42 Author: Pan Xinhui <xinhui@linux.vnet.ibm.com> AuthorDate: Wed, 2 Nov 2016 05:08:34 -0400 Committer: Ingo Molnar <mi...@kernel.org> CommitDate:

[tip:locking/core] kvm: Introduce kvm_write_guest_offset_cached()

2016-11-22 Thread tip-bot for Pan Xinhui
Commit-ID: 4ec6e863625625a54f527464ab91ce1a1cb16c42 Gitweb: http://git.kernel.org/tip/4ec6e863625625a54f527464ab91ce1a1cb16c42 Author: Pan Xinhui AuthorDate: Wed, 2 Nov 2016 05:08:34 -0400 Committer: Ingo Molnar CommitDate: Tue, 22 Nov 2016 12:48:07 +0100 kvm: Introduce

[tip:locking/core] locking/core, x86/paravirt: Implement vcpu_is_preempted(cpu) for KVM and Xen guests

2016-11-22 Thread tip-bot for Pan Xinhui
Commit-ID: 446f3dc8cc0af59259c6c8b898726fae7ed2c055 Gitweb: http://git.kernel.org/tip/446f3dc8cc0af59259c6c8b898726fae7ed2c055 Author: Pan Xinhui <xinhui@linux.vnet.ibm.com> AuthorDate: Wed, 2 Nov 2016 05:08:33 -0400 Committer: Ingo Molnar <mi...@kernel.org> CommitDate:

[tip:locking/core] locking/core, x86/paravirt: Implement vcpu_is_preempted(cpu) for KVM and Xen guests

2016-11-22 Thread tip-bot for Pan Xinhui
Commit-ID: 446f3dc8cc0af59259c6c8b898726fae7ed2c055 Gitweb: http://git.kernel.org/tip/446f3dc8cc0af59259c6c8b898726fae7ed2c055 Author: Pan Xinhui AuthorDate: Wed, 2 Nov 2016 05:08:33 -0400 Committer: Ingo Molnar CommitDate: Tue, 22 Nov 2016 12:48:07 +0100 locking/core, x86/paravirt

[tip:locking/core] sched/core: Introduce the vcpu_is_preempted(cpu) interface

2016-11-22 Thread tip-bot for Pan Xinhui
Commit-ID: d9345c65eb7930ac6755cf593ee7686f4029ccf4 Gitweb: http://git.kernel.org/tip/d9345c65eb7930ac6755cf593ee7686f4029ccf4 Author: Pan Xinhui <xinhui@linux.vnet.ibm.com> AuthorDate: Wed, 2 Nov 2016 05:08:28 -0400 Committer: Ingo Molnar <mi...@kernel.org> CommitDate:

[tip:locking/core] locking/core, powerpc: Implement vcpu_is_preempted(cpu)

2016-11-22 Thread tip-bot for Pan Xinhui
Commit-ID: 41946c86876ea6a3e8857182356e6d76dbfe7fb6 Gitweb: http://git.kernel.org/tip/41946c86876ea6a3e8857182356e6d76dbfe7fb6 Author: Pan Xinhui <xinhui@linux.vnet.ibm.com> AuthorDate: Wed, 2 Nov 2016 05:08:31 -0400 Committer: Ingo Molnar <mi...@kernel.org> CommitDate:

[tip:locking/core] sched/core: Introduce the vcpu_is_preempted(cpu) interface

2016-11-22 Thread tip-bot for Pan Xinhui
Commit-ID: d9345c65eb7930ac6755cf593ee7686f4029ccf4 Gitweb: http://git.kernel.org/tip/d9345c65eb7930ac6755cf593ee7686f4029ccf4 Author: Pan Xinhui AuthorDate: Wed, 2 Nov 2016 05:08:28 -0400 Committer: Ingo Molnar CommitDate: Tue, 22 Nov 2016 12:48:05 +0100 sched/core: Introduce

[tip:locking/core] locking/core, powerpc: Implement vcpu_is_preempted(cpu)

2016-11-22 Thread tip-bot for Pan Xinhui
Commit-ID: 41946c86876ea6a3e8857182356e6d76dbfe7fb6 Gitweb: http://git.kernel.org/tip/41946c86876ea6a3e8857182356e6d76dbfe7fb6 Author: Pan Xinhui AuthorDate: Wed, 2 Nov 2016 05:08:31 -0400 Committer: Ingo Molnar CommitDate: Tue, 22 Nov 2016 12:48:06 +0100 locking/core, powerpc

Re: [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

  1   2   3   4   5   6   7   >