linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFC 21/26] powerpc: Remove spin_unlock_wait() arch-specific definitions
       [not found] <20170629235918.GA6445@linux.vnet.ibm.com>
@ 2017-06-30  0:01 ` Paul E. McKenney
  2017-07-02  3:58   ` Boqun Feng
  0 siblings, 1 reply; 3+ messages in thread
From: Paul E. McKenney @ 2017-06-30  0:01 UTC (permalink / raw)
  To: linux-kernel
  Cc: netfilter-devel, netdev, oleg, akpm, mingo, dave, manfred, tj,
	arnd, linux-arch, will.deacon, peterz, stern, parri.andrea,
	torvalds, Paul E. McKenney, Benjamin Herrenschmidt,
	Paul Mackerras, Michael Ellerman, linuxppc-dev

There is no agreed-upon definition of spin_unlock_wait()'s semantics,
and it appears that all callers could do just as well with a lock/unlock
pair.  This commit therefore removes the underlying arch-specific
arch_spin_unlock_wait().

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: <linuxppc-dev@lists.ozlabs.org>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Andrea Parri <parri.andrea@gmail.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
---
 arch/powerpc/include/asm/spinlock.h | 33 ---------------------------------
 1 file changed, 33 deletions(-)

diff --git a/arch/powerpc/include/asm/spinlock.h b/arch/powerpc/include/asm/spinlock.h
index 8c1b913de6d7..d256e448ea49 100644
--- a/arch/powerpc/include/asm/spinlock.h
+++ b/arch/powerpc/include/asm/spinlock.h
@@ -170,39 +170,6 @@ static inline void arch_spin_unlock(arch_spinlock_t *lock)
 	lock->slock = 0;
 }
 
-static inline void arch_spin_unlock_wait(arch_spinlock_t *lock)
-{
-	arch_spinlock_t lock_val;
-
-	smp_mb();
-
-	/*
-	 * Atomically load and store back the lock value (unchanged). This
-	 * ensures that our observation of the lock value is ordered with
-	 * respect to other lock operations.
-	 */
-	__asm__ __volatile__(
-"1:	" PPC_LWARX(%0, 0, %2, 0) "\n"
-"	stwcx. %0, 0, %2\n"
-"	bne- 1b\n"
-	: "=&r" (lock_val), "+m" (*lock)
-	: "r" (lock)
-	: "cr0", "xer");
-
-	if (arch_spin_value_unlocked(lock_val))
-		goto out;
-
-	while (lock->slock) {
-		HMT_low();
-		if (SHARED_PROCESSOR)
-			__spin_yield(lock);
-	}
-	HMT_medium();
-
-out:
-	smp_mb();
-}
-
 /*
  * Read-write spinlocks, allowing multiple readers
  * but only one writer.
-- 
2.5.2

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH RFC 21/26] powerpc: Remove spin_unlock_wait() arch-specific definitions
  2017-06-30  0:01 ` [PATCH RFC 21/26] powerpc: Remove spin_unlock_wait() arch-specific definitions Paul E. McKenney
@ 2017-07-02  3:58   ` Boqun Feng
  2017-07-05 23:57     ` Paul E. McKenney
  0 siblings, 1 reply; 3+ messages in thread
From: Boqun Feng @ 2017-07-02  3:58 UTC (permalink / raw)
  To: Paul E. McKenney
  Cc: linux-kernel, linux-arch, parri.andrea, dave, manfred, arnd,
	peterz, netdev, linuxppc-dev, will.deacon, oleg, mingo,
	netfilter-devel, tj, stern, akpm, torvalds, Paul Mackerras

[-- Attachment #1: Type: text/plain, Size: 2192 bytes --]

On Thu, Jun 29, 2017 at 05:01:29PM -0700, Paul E. McKenney wrote:
> There is no agreed-upon definition of spin_unlock_wait()'s semantics,
> and it appears that all callers could do just as well with a lock/unlock
> pair.  This commit therefore removes the underlying arch-specific
> arch_spin_unlock_wait().
> 
> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Cc: Paul Mackerras <paulus@samba.org>
> Cc: Michael Ellerman <mpe@ellerman.id.au>
> Cc: <linuxppc-dev@lists.ozlabs.org>
> Cc: Will Deacon <will.deacon@arm.com>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Alan Stern <stern@rowland.harvard.edu>
> Cc: Andrea Parri <parri.andrea@gmail.com>
> Cc: Linus Torvalds <torvalds@linux-foundation.org>

Acked-by: Boqun Feng <boqun.feng@gmail.com>

Regards,
Boqun

> ---
>  arch/powerpc/include/asm/spinlock.h | 33 ---------------------------------
>  1 file changed, 33 deletions(-)
> 
> diff --git a/arch/powerpc/include/asm/spinlock.h b/arch/powerpc/include/asm/spinlock.h
> index 8c1b913de6d7..d256e448ea49 100644
> --- a/arch/powerpc/include/asm/spinlock.h
> +++ b/arch/powerpc/include/asm/spinlock.h
> @@ -170,39 +170,6 @@ static inline void arch_spin_unlock(arch_spinlock_t *lock)
>  	lock->slock = 0;
>  }
>  
> -static inline void arch_spin_unlock_wait(arch_spinlock_t *lock)
> -{
> -	arch_spinlock_t lock_val;
> -
> -	smp_mb();
> -
> -	/*
> -	 * Atomically load and store back the lock value (unchanged). This
> -	 * ensures that our observation of the lock value is ordered with
> -	 * respect to other lock operations.
> -	 */
> -	__asm__ __volatile__(
> -"1:	" PPC_LWARX(%0, 0, %2, 0) "\n"
> -"	stwcx. %0, 0, %2\n"
> -"	bne- 1b\n"
> -	: "=&r" (lock_val), "+m" (*lock)
> -	: "r" (lock)
> -	: "cr0", "xer");
> -
> -	if (arch_spin_value_unlocked(lock_val))
> -		goto out;
> -
> -	while (lock->slock) {
> -		HMT_low();
> -		if (SHARED_PROCESSOR)
> -			__spin_yield(lock);
> -	}
> -	HMT_medium();
> -
> -out:
> -	smp_mb();
> -}
> -
>  /*
>   * Read-write spinlocks, allowing multiple readers
>   * but only one writer.
> -- 
> 2.5.2
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH RFC 21/26] powerpc: Remove spin_unlock_wait() arch-specific definitions
  2017-07-02  3:58   ` Boqun Feng
@ 2017-07-05 23:57     ` Paul E. McKenney
  0 siblings, 0 replies; 3+ messages in thread
From: Paul E. McKenney @ 2017-07-05 23:57 UTC (permalink / raw)
  To: Boqun Feng
  Cc: linux-kernel, linux-arch, parri.andrea, dave, manfred, arnd,
	peterz, netdev, linuxppc-dev, will.deacon, oleg, mingo,
	netfilter-devel, tj, stern, akpm, torvalds, Paul Mackerras

On Sun, Jul 02, 2017 at 11:58:07AM +0800, Boqun Feng wrote:
> On Thu, Jun 29, 2017 at 05:01:29PM -0700, Paul E. McKenney wrote:
> > There is no agreed-upon definition of spin_unlock_wait()'s semantics,
> > and it appears that all callers could do just as well with a lock/unlock
> > pair.  This commit therefore removes the underlying arch-specific
> > arch_spin_unlock_wait().
> > 
> > Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> > Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> > Cc: Paul Mackerras <paulus@samba.org>
> > Cc: Michael Ellerman <mpe@ellerman.id.au>
> > Cc: <linuxppc-dev@lists.ozlabs.org>
> > Cc: Will Deacon <will.deacon@arm.com>
> > Cc: Peter Zijlstra <peterz@infradead.org>
> > Cc: Alan Stern <stern@rowland.harvard.edu>
> > Cc: Andrea Parri <parri.andrea@gmail.com>
> > Cc: Linus Torvalds <torvalds@linux-foundation.org>
> 
> Acked-by: Boqun Feng <boqun.feng@gmail.com>

And finally applied in preparation for v2 of the patch series.

Thank you!!!

							Thanx, Paul

> Regards,
> Boqun
> 
> > ---
> >  arch/powerpc/include/asm/spinlock.h | 33 ---------------------------------
> >  1 file changed, 33 deletions(-)
> > 
> > diff --git a/arch/powerpc/include/asm/spinlock.h b/arch/powerpc/include/asm/spinlock.h
> > index 8c1b913de6d7..d256e448ea49 100644
> > --- a/arch/powerpc/include/asm/spinlock.h
> > +++ b/arch/powerpc/include/asm/spinlock.h
> > @@ -170,39 +170,6 @@ static inline void arch_spin_unlock(arch_spinlock_t *lock)
> >  	lock->slock = 0;
> >  }
> >  
> > -static inline void arch_spin_unlock_wait(arch_spinlock_t *lock)
> > -{
> > -	arch_spinlock_t lock_val;
> > -
> > -	smp_mb();
> > -
> > -	/*
> > -	 * Atomically load and store back the lock value (unchanged). This
> > -	 * ensures that our observation of the lock value is ordered with
> > -	 * respect to other lock operations.
> > -	 */
> > -	__asm__ __volatile__(
> > -"1:	" PPC_LWARX(%0, 0, %2, 0) "\n"
> > -"	stwcx. %0, 0, %2\n"
> > -"	bne- 1b\n"
> > -	: "=&r" (lock_val), "+m" (*lock)
> > -	: "r" (lock)
> > -	: "cr0", "xer");
> > -
> > -	if (arch_spin_value_unlocked(lock_val))
> > -		goto out;
> > -
> > -	while (lock->slock) {
> > -		HMT_low();
> > -		if (SHARED_PROCESSOR)
> > -			__spin_yield(lock);
> > -	}
> > -	HMT_medium();
> > -
> > -out:
> > -	smp_mb();
> > -}
> > -
> >  /*
> >   * Read-write spinlocks, allowing multiple readers
> >   * but only one writer.
> > -- 
> > 2.5.2
> > 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-07-05 23:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20170629235918.GA6445@linux.vnet.ibm.com>
2017-06-30  0:01 ` [PATCH RFC 21/26] powerpc: Remove spin_unlock_wait() arch-specific definitions Paul E. McKenney
2017-07-02  3:58   ` Boqun Feng
2017-07-05 23:57     ` Paul E. McKenney

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).