Re: [PATCH 2/3] powerpc/spinlock: support vcpu preempted check

2016-06-27 Thread xinhui
On 2016年06月28日 13:03, Boqun Feng wrote: On Tue, Jun 28, 2016 at 11:39:18AM +0800, xinhui wrote: [snip] +{ + struct lppaca *lp = _of(cpu); + + if (unlikely(!(lppaca_shared_proc(lp) || + lppaca_dedicated_proc(lp Do you want to detect whether we are

Re: [PATCH 2/3] powerpc/spinlock: support vcpu preempted check

2016-06-27 Thread Boqun Feng
On Tue, Jun 28, 2016 at 11:39:18AM +0800, xinhui wrote: [snip] > > > +{ > > > + struct lppaca *lp = _of(cpu); > > > + > > > + if (unlikely(!(lppaca_shared_proc(lp) || > > > + lppaca_dedicated_proc(lp > > > > Do you want to detect whether we are running in a guest(ie. pseries >

Re: [PATCH 2/3] powerpc/spinlock: support vcpu preempted check

2016-06-27 Thread xinhui
On 2016年06月27日 22:58, Boqun Feng wrote: Hi Xinhui, On Mon, Jun 27, 2016 at 01:41:29PM -0400, Pan Xinhui wrote: This is to fix some holder preemption issues. Spinning at one vcpu which is preempted is meaningless. Kernel need such interfaces, So lets support it. We also should suooprt both

Re: [PATCH 2/3] powerpc/spinlock: support vcpu preempted check

2016-06-27 Thread xinhui
On 2016年06月27日 22:17, Peter Zijlstra wrote: On Mon, Jun 27, 2016 at 01:41:29PM -0400, Pan Xinhui wrote: diff --git a/arch/powerpc/include/asm/spinlock.h b/arch/powerpc/include/asm/spinlock.h index 523673d..ae938ee 100644 --- a/arch/powerpc/include/asm/spinlock.h +++

Re: [PATCH 2/3] powerpc/spinlock: support vcpu preempted check

2016-06-27 Thread Boqun Feng
Hi Xinhui, On Mon, Jun 27, 2016 at 01:41:29PM -0400, Pan Xinhui wrote: > This is to fix some holder preemption issues. Spinning at one > vcpu which is preempted is meaningless. > > Kernel need such interfaces, So lets support it. > > We also should suooprt both the shared and dedicated mode. >

Re: [PATCH 2/3] powerpc/spinlock: support vcpu preempted check

2016-06-27 Thread Peter Zijlstra
On Mon, Jun 27, 2016 at 01:41:29PM -0400, Pan Xinhui wrote: > diff --git a/arch/powerpc/include/asm/spinlock.h > b/arch/powerpc/include/asm/spinlock.h > index 523673d..ae938ee 100644 > --- a/arch/powerpc/include/asm/spinlock.h > +++ b/arch/powerpc/include/asm/spinlock.h > @@ -52,6 +52,21 @@ >