lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 4 Aug 2021 17:17:36 -0400
From:   Waiman Long <llong@...hat.com>
To:     Thomas Gleixner <tglx@...utronix.de>,
        LKML <linux-kernel@...r.kernel.org>
Cc:     Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...nel.org>,
        Juri Lelli <juri.lelli@...hat.com>,
        Steven Rostedt <rostedt@...dmis.org>,
        Daniel Bristot de Oliveira <bristot@...hat.com>,
        Will Deacon <will@...nel.org>,
        Boqun Feng <boqun.feng@...il.com>,
        Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
        Davidlohr Bueso <dave@...olabs.net>
Subject: Re: [patch 22/63] locking/spinlock: Split the lock types header

On 7/30/21 9:50 AM, Thomas Gleixner wrote:
> From: Thomas Gleixner <tglx@...utronix.de>
>
> Move raw_spinlock into its own file. Prepare for RT 'sleeping spinlocks' to
> avoid header recursion as RT locks require rtmutex.h which in turn requires
> the raw spinlock types.
>
> No functional change.
>
> Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
> ---
>   include/linux/rwlock_types.h       |    4 ++
>   include/linux/spinlock.h           |    4 ++
>   include/linux/spinlock_types.h     |   19 ----------
>   include/linux/spinlock_types_raw.h |   65 +++++++++++++++++++++++++++++++++++++
>   4 files changed, 74 insertions(+), 18 deletions(-)
>   create mode 100644 include/linux/spinlock_types_raw.h
> ---
> --- a/include/linux/rwlock_types.h
> +++ b/include/linux/rwlock_types.h
> @@ -1,6 +1,10 @@
>   #ifndef __LINUX_RWLOCK_TYPES_H
>   #define __LINUX_RWLOCK_TYPES_H
>   
> +#if !defined(__LINUX_SPINLOCK_TYPES_H)
> +# error "Do not include directly, include spinlock_types.h"
> +#endif
> +
>   /*
>    * include/linux/rwlock_types.h - generic rwlock type definitions
>    *				  and initializers
> --- a/include/linux/spinlock.h
> +++ b/include/linux/spinlock.h
> @@ -12,6 +12,8 @@
>    *  asm/spinlock_types.h: contains the arch_spinlock_t/arch_rwlock_t and the
>    *                        initializers
>    *
> + *  linux/spinlock_types_raw:
> + *			  The raw types and initializers
>    *  linux/spinlock_types.h:
>    *                        defines the generic type and initializers
>    *
> @@ -31,6 +33,8 @@
>    *                        contains the generic, simplified UP spinlock type.
>    *                        (which is an empty structure on non-debug builds)
>    *
> + *  linux/spinlock_types_raw:
> + *			  The raw RT types and initializers
>    *  linux/spinlock_types.h:
>    *                        defines the generic type and initializers
>    *
> --- a/include/linux/spinlock_types.h
> +++ b/include/linux/spinlock_types.h
> @@ -9,24 +9,7 @@
>    * Released under the General Public License (GPL).
>    */
>   
> -#if defined(CONFIG_SMP)
> -# include <asm/spinlock_types.h>
> -#else
> -# include <linux/spinlock_types_up.h>
> -#endif
> -
> -#include <linux/lockdep_types.h>
> -
> -typedef struct raw_spinlock {
> -	arch_spinlock_t raw_lock;
> -#ifdef CONFIG_DEBUG_SPINLOCK
> -	unsigned int magic, owner_cpu;
> -	void *owner;
> -#endif
> -#ifdef CONFIG_DEBUG_LOCK_ALLOC
> -	struct lockdep_map dep_map;
> -#endif
> -} raw_spinlock_t;
> +#include <linux/spinlock_types_raw.h>
>   
>   #define SPINLOCK_MAGIC		0xdead4ead
>   

Most of the code in spinlock_types.h are moved into 
spinlock_types_raw.h. However, macros like SPINLOCK_MAGIC and those that 
followed are not removed from spinlock_types.h in this patch leading to 
the same set of macro definitions in two different files. Should we 
eliminate the duplicate macro definitions either from spinlock_types.h 
or from spinlock_types_raw.h?

Cheers,
Longman

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ