public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] locking/qspinlock: move __ARCH_SPIN_LOCK_UNLOCKED to qspinlock_types.h
@ 2016-02-19 18:49 Dan Streetman
  2016-02-19 21:09 ` Long, Wai Man
  2016-02-29 11:22 ` [tip:locking/core] locking/qspinlock: Move " tip-bot for Dan Streetman
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Streetman @ 2016-02-19 18:49 UTC (permalink / raw)
  To: Waiman Long, Peter Zijlstra, Arnd Bergmann
  Cc: linux-arch, linux-kernel, Dan Streetman, Dan Streetman

Move __ARCH_SPIN_LOCK_UNLOCKED definition from qspinlock.h into
qspinlock_types.h.

The definition of __ARCH_SPIN_LOCK_UNLOCKED comes from the build arch's
include files; but on x86 when CONFIG_QUEUED_SPINLOCKS is set, it just
it's defined in asm-generic/qspinlock.h.  In most cases, this doesn't
matter because linux/spinlock.h includes asm/spinlock.h, which for x86
includes asm-generic/qspinlock.h.  However, any code that only includes
linux/mutex.h will break, because it only includes asm/spinlock_types.h.

For example, this breaks systemtap, which only includes mutex.h.

Signed-off-by: Dan Streetman <dan.streetman@canonical.com>
Cc: Dan Streetman <ddstreet@ieee.org>
---
 include/asm-generic/qspinlock.h       | 5 -----
 include/asm-generic/qspinlock_types.h | 5 +++++
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/include/asm-generic/qspinlock.h b/include/asm-generic/qspinlock.h
index 39e1cb2..35a52a8 100644
--- a/include/asm-generic/qspinlock.h
+++ b/include/asm-generic/qspinlock.h
@@ -120,11 +120,6 @@ static __always_inline bool virt_spin_lock(struct qspinlock *lock)
 #endif
 
 /*
- * Initializier
- */
-#define	__ARCH_SPIN_LOCK_UNLOCKED	{ ATOMIC_INIT(0) }
-
-/*
  * Remapping spinlock architecture specific functions to the corresponding
  * queued spinlock functions.
  */
diff --git a/include/asm-generic/qspinlock_types.h b/include/asm-generic/qspinlock_types.h
index 85f888e..034acd0 100644
--- a/include/asm-generic/qspinlock_types.h
+++ b/include/asm-generic/qspinlock_types.h
@@ -33,6 +33,11 @@ typedef struct qspinlock {
 } arch_spinlock_t;
 
 /*
+ * Initializier
+ */
+#define	__ARCH_SPIN_LOCK_UNLOCKED	{ ATOMIC_INIT(0) }
+
+/*
  * Bitfields in the atomic value:
  *
  * When NR_CPUS < 16K
-- 
2.5.0

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

* Re: [PATCH] locking/qspinlock: move __ARCH_SPIN_LOCK_UNLOCKED to qspinlock_types.h
  2016-02-19 18:49 [PATCH] locking/qspinlock: move __ARCH_SPIN_LOCK_UNLOCKED to qspinlock_types.h Dan Streetman
@ 2016-02-19 21:09 ` Long, Wai Man
  2016-02-29 11:22 ` [tip:locking/core] locking/qspinlock: Move " tip-bot for Dan Streetman
  1 sibling, 0 replies; 3+ messages in thread
From: Long, Wai Man @ 2016-02-19 21:09 UTC (permalink / raw)
  To: Dan Streetman
  Cc: Peter Zijlstra, Arnd Bergmann, linux-arch@vger.kernel.org,
	linux-kernel@vger.kernel.org, Dan Streetman

On 02/19/2016 01:49 PM, Dan Streetman wrote:
> Move __ARCH_SPIN_LOCK_UNLOCKED definition from qspinlock.h into
> qspinlock_types.h.
>
> The definition of __ARCH_SPIN_LOCK_UNLOCKED comes from the build arch's
> include files; but on x86 when CONFIG_QUEUED_SPINLOCKS is set, it just
> it's defined in asm-generic/qspinlock.h.  In most cases, this doesn't
> matter because linux/spinlock.h includes asm/spinlock.h, which for x86
> includes asm-generic/qspinlock.h.  However, any code that only includes
> linux/mutex.h will break, because it only includes asm/spinlock_types.h.
>
> For example, this breaks systemtap, which only includes mutex.h.
>
> Signed-off-by: Dan Streetman<dan.streetman@canonical.com>
> Cc: Dan Streetman<ddstreet@ieee.org>
> ---
>   include/asm-generic/qspinlock.h       | 5 -----
>   include/asm-generic/qspinlock_types.h | 5 +++++
>   2 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/include/asm-generic/qspinlock.h b/include/asm-generic/qspinlock.h
> index 39e1cb2..35a52a8 100644
> --- a/include/asm-generic/qspinlock.h
> +++ b/include/asm-generic/qspinlock.h
> @@ -120,11 +120,6 @@ static __always_inline bool virt_spin_lock(struct qspinlock *lock)
>   #endif
>
>   /*
> - * Initializier
> - */
> -#define	__ARCH_SPIN_LOCK_UNLOCKED	{ ATOMIC_INIT(0) }
> -
> -/*
>    * Remapping spinlock architecture specific functions to the corresponding
>    * queued spinlock functions.
>    */
> diff --git a/include/asm-generic/qspinlock_types.h b/include/asm-generic/qspinlock_types.h
> index 85f888e..034acd0 100644
> --- a/include/asm-generic/qspinlock_types.h
> +++ b/include/asm-generic/qspinlock_types.h
> @@ -33,6 +33,11 @@ typedef struct qspinlock {
>   } arch_spinlock_t;
>
>   /*
> + * Initializier
> + */
> +#define	__ARCH_SPIN_LOCK_UNLOCKED	{ ATOMIC_INIT(0) }
> +
> +/*
>    * Bitfields in the atomic value:
>    *
>    * When NR_CPUS<  16K
Acked-by: Waiman Long <Waiman.Long@hpe.com>

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

* [tip:locking/core] locking/qspinlock: Move __ARCH_SPIN_LOCK_UNLOCKED to qspinlock_types.h
  2016-02-19 18:49 [PATCH] locking/qspinlock: move __ARCH_SPIN_LOCK_UNLOCKED to qspinlock_types.h Dan Streetman
  2016-02-19 21:09 ` Long, Wai Man
@ 2016-02-29 11:22 ` tip-bot for Dan Streetman
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Dan Streetman @ 2016-02-29 11:22 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: akpm, linux-kernel, arnd, peterz, ddstreet, torvalds, mingo,
	dan.streetman, hpa, paulmck, tglx, Waiman.Long

Commit-ID:  b82e530290a0437522720becaf4abdf8ca4cb7d2
Gitweb:     http://git.kernel.org/tip/b82e530290a0437522720becaf4abdf8ca4cb7d2
Author:     Dan Streetman <dan.streetman@canonical.com>
AuthorDate: Fri, 19 Feb 2016 13:49:27 -0500
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Mon, 29 Feb 2016 10:02:43 +0100

locking/qspinlock: Move __ARCH_SPIN_LOCK_UNLOCKED to qspinlock_types.h

Move the __ARCH_SPIN_LOCK_UNLOCKED definition from qspinlock.h into
qspinlock_types.h.

The definition of __ARCH_SPIN_LOCK_UNLOCKED comes from the build arch's
include files; but on x86 when CONFIG_QUEUED_SPINLOCKS=y, it just
it's defined in asm-generic/qspinlock.h.  In most cases, this doesn't
matter because linux/spinlock.h includes asm/spinlock.h, which for x86
includes asm-generic/qspinlock.h.  However, any code that only includes
linux/mutex.h will break, because it only includes asm/spinlock_types.h.

For example, this breaks systemtap, which only includes mutex.h.

Signed-off-by: Dan Streetman <dan.streetman@canonical.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Waiman Long <Waiman.Long@hpe.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Dan Streetman <ddstreet@ieee.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1455907767-17821-1-git-send-email-dan.streetman@canonical.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 include/asm-generic/qspinlock.h       | 5 -----
 include/asm-generic/qspinlock_types.h | 5 +++++
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/include/asm-generic/qspinlock.h b/include/asm-generic/qspinlock.h
index 39e1cb2..35a52a8 100644
--- a/include/asm-generic/qspinlock.h
+++ b/include/asm-generic/qspinlock.h
@@ -120,11 +120,6 @@ static __always_inline bool virt_spin_lock(struct qspinlock *lock)
 #endif
 
 /*
- * Initializier
- */
-#define	__ARCH_SPIN_LOCK_UNLOCKED	{ ATOMIC_INIT(0) }
-
-/*
  * Remapping spinlock architecture specific functions to the corresponding
  * queued spinlock functions.
  */
diff --git a/include/asm-generic/qspinlock_types.h b/include/asm-generic/qspinlock_types.h
index 85f888e..034acd0 100644
--- a/include/asm-generic/qspinlock_types.h
+++ b/include/asm-generic/qspinlock_types.h
@@ -33,6 +33,11 @@ typedef struct qspinlock {
 } arch_spinlock_t;
 
 /*
+ * Initializier
+ */
+#define	__ARCH_SPIN_LOCK_UNLOCKED	{ ATOMIC_INIT(0) }
+
+/*
  * Bitfields in the atomic value:
  *
  * When NR_CPUS < 16K

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

end of thread, other threads:[~2016-02-29 11:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-19 18:49 [PATCH] locking/qspinlock: move __ARCH_SPIN_LOCK_UNLOCKED to qspinlock_types.h Dan Streetman
2016-02-19 21:09 ` Long, Wai Man
2016-02-29 11:22 ` [tip:locking/core] locking/qspinlock: Move " tip-bot for Dan Streetman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox