Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1338411 > unrolled thread
| Started by | Dan Streetman <dan.streetman@canonical.com> |
|---|---|
| First post | 2016-02-19 20:00 +0100 |
| Last post | 2016-02-19 22:10 +0100 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH] locking/qspinlock: move __ARCH_SPIN_LOCK_UNLOCKED to qspinlock_types.h Dan Streetman <dan.streetman@canonical.com> - 2016-02-19 20:00 +0100
Re: [PATCH] locking/qspinlock: move __ARCH_SPIN_LOCK_UNLOCKED to qspinlock_types.h "Long, Wai Man" <waiman.long@hpe.com> - 2016-02-19 22:10 +0100
| From | Dan Streetman <dan.streetman@canonical.com> |
|---|---|
| Date | 2016-02-19 20:00 +0100 |
| Subject | [PATCH] locking/qspinlock: move __ARCH_SPIN_LOCK_UNLOCKED to qspinlock_types.h |
| Message-ID | <r3Yrw-1eR-5@gated-at.bofh.it> |
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
[toc] | [next] | [standalone]
| From | "Long, Wai Man" <waiman.long@hpe.com> |
|---|---|
| Date | 2016-02-19 22:10 +0100 |
| Subject | Re: [PATCH] locking/qspinlock: move __ARCH_SPIN_LOCK_UNLOCKED to qspinlock_types.h |
| Message-ID | <r40tk-2SE-17@gated-at.bofh.it> |
| In reply to | #1338411 |
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>
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web