mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v3 RESEND 0/2] locking/local_lock: shadowing and maintainers entry
@ 2025-11-27 14:41 Sebastian Andrzej Siewior
  2025-11-27 14:41 ` [PATCH 1/2] locking: Add local_locks to MAINTAINERS Sebastian Andrzej Siewior
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Sebastian Andrzej Siewior @ 2025-11-27 14:41 UTC (permalink / raw)
  To: linux-kernel, linux-rt-devel
  Cc: tglx, Peter Zijlstra, Ingo Molnar, Will Deacon, Waiman Long,
	Sebastian Andrzej Siewior

This is a repost of two individual postings earlier:
	https://lore.kernel.org/all/20250927090110.t8Tm9yrk@linutronix.de/	
	https://lore.kernel.org/all/20251009103900.2Fk8stnM@linutronix.de/

Sebastian Andrzej Siewior (1):
  locking: Add local_locks to MAINTAINERS

Vincent Mailhol (1):
  locking/local_lock: s/l/__l/ and s/tl/__tl/ to reduce risk of
    shadowing

 MAINTAINERS                         |  1 +
 include/linux/local_lock_internal.h | 62 ++++++++++++++---------------
 2 files changed, 32 insertions(+), 31 deletions(-)

-- 
2.51.0


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

* [PATCH 1/2] locking: Add local_locks to MAINTAINERS
  2025-11-27 14:41 [PATCH v3 RESEND 0/2] locking/local_lock: shadowing and maintainers entry Sebastian Andrzej Siewior
@ 2025-11-27 14:41 ` Sebastian Andrzej Siewior
  2025-11-29 11:49   ` [tip: locking/core] " tip-bot2 for Sebastian Andrzej Siewior
  2025-12-01  6:01   ` [tip: locking/core] locking/local_lock: Add the <linux/local_lock*.h> headers " tip-bot2 for Sebastian Andrzej Siewior
  2025-11-27 14:41 ` [PATCH 2/2] locking/local_lock: s/l/__l/ and s/tl/__tl/ to reduce risk of shadowing Sebastian Andrzej Siewior
  2025-11-28 10:04 ` [PATCH v3 RESEND 0/2] locking/local_lock: shadowing and maintainers entry Peter Zijlstra
  2 siblings, 2 replies; 8+ messages in thread
From: Sebastian Andrzej Siewior @ 2025-11-27 14:41 UTC (permalink / raw)
  To: linux-kernel, linux-rt-devel
  Cc: tglx, Peter Zijlstra, Ingo Molnar, Will Deacon, Waiman Long,
	Sebastian Andrzej Siewior, Vlastimil Babka

The local_lock_t was never added to the MAINTAINERS file since its
inclusion.

Add local_lock_t to the locking primitives section.

Cc: Vlastimil Babka <vbabka@suse.cz>
Acked-by: Waiman Long <longman@redhat.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 MAINTAINERS | 1 +
 1 file changed, 1 insertion(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 6df89b14b521a..6939d27bc1f2d 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -14535,6 +14535,7 @@ S:	Maintained
 T:	git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git locking/core
 F:	Documentation/locking/
 F:	arch/*/include/asm/spinlock*.h
+F:	include/linux/local_lock*.h
 F:	include/linux/lockdep*.h
 F:	include/linux/mutex*.h
 F:	include/linux/rwlock*.h
-- 
2.51.0


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

* [PATCH 2/2] locking/local_lock: s/l/__l/ and s/tl/__tl/ to reduce risk of shadowing
  2025-11-27 14:41 [PATCH v3 RESEND 0/2] locking/local_lock: shadowing and maintainers entry Sebastian Andrzej Siewior
  2025-11-27 14:41 ` [PATCH 1/2] locking: Add local_locks to MAINTAINERS Sebastian Andrzej Siewior
@ 2025-11-27 14:41 ` Sebastian Andrzej Siewior
  2025-11-29 11:49   ` [tip: locking/core] " tip-bot2 for Vincent Mailhol
  2025-12-01  6:01   ` [tip: locking/core] locking/local_lock: s/l/__l/ and s/tl/__tl/ to reduce the " tip-bot2 for Vincent Mailhol
  2025-11-28 10:04 ` [PATCH v3 RESEND 0/2] locking/local_lock: shadowing and maintainers entry Peter Zijlstra
  2 siblings, 2 replies; 8+ messages in thread
From: Sebastian Andrzej Siewior @ 2025-11-27 14:41 UTC (permalink / raw)
  To: linux-kernel, linux-rt-devel
  Cc: tglx, Peter Zijlstra, Ingo Molnar, Will Deacon, Waiman Long,
	Vincent Mailhol, Sebastian Andrzej Siewior

From: Vincent Mailhol <mailhol@kernel.org>

The Linux kernel coding style advises to avoid common variable
names in function-like macros to reduce the risk of collisions.

Throughout local_lock_internal.h, several macros use the rather common
variable names 'l' and 'tl'. This already resulted in an actual
collision: the __local_lock_acquire() function like macro is currently
shadowing the parameter 'l' of the:

  class_##_name##_t class_##_name##_constructor(_type *l)

function factory from linux/cleanup.h.

Rename the variable 'l' to '__l' and the variable 'tl' to '__tl'
throughout the file to fix the current name collision and to prevent
future ones.

[ bigeasy: Rebase, update all l and tl instances in macros ]

Signed-off-by: Vincent Mailhol <mailhol@kernel.org>
Acked-by: Waiman Long <longman@redhat.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 include/linux/local_lock_internal.h | 62 ++++++++++++++---------------
 1 file changed, 31 insertions(+), 31 deletions(-)

diff --git a/include/linux/local_lock_internal.h b/include/linux/local_lock_internal.h
index a4dc479157b5c..8f82b4eb542f2 100644
--- a/include/linux/local_lock_internal.h
+++ b/include/linux/local_lock_internal.h
@@ -99,18 +99,18 @@ do {								\
 
 #define __local_lock_acquire(lock)					\
 	do {								\
-		local_trylock_t *tl;					\
-		local_lock_t *l;					\
+		local_trylock_t *__tl;					\
+		local_lock_t *__l;					\
 									\
-		l = (local_lock_t *)(lock);				\
-		tl = (local_trylock_t *)l;				\
+		__l = (local_lock_t *)(lock);				\
+		__tl = (local_trylock_t *)__l;				\
 		_Generic((lock),					\
 			local_trylock_t *: ({				\
-				lockdep_assert(tl->acquired == 0);	\
-				WRITE_ONCE(tl->acquired, 1);		\
+				lockdep_assert(__tl->acquired == 0);	\
+				WRITE_ONCE(__tl->acquired, 1);		\
 			}),						\
 			local_lock_t *: (void)0);			\
-		local_lock_acquire(l);					\
+		local_lock_acquire(__l);				\
 	} while (0)
 
 #define __local_lock(lock)					\
@@ -133,36 +133,36 @@ do {								\
 
 #define __local_trylock(lock)					\
 	({							\
-		local_trylock_t *tl;				\
+		local_trylock_t *__tl;				\
 								\
 		preempt_disable();				\
-		tl = (lock);					\
-		if (READ_ONCE(tl->acquired)) {			\
+		__tl = (lock);					\
+		if (READ_ONCE(__tl->acquired)) {		\
 			preempt_enable();			\
-			tl = NULL;				\
+			__tl = NULL;				\
 		} else {					\
-			WRITE_ONCE(tl->acquired, 1);		\
+			WRITE_ONCE(__tl->acquired, 1);		\
 			local_trylock_acquire(			\
-				(local_lock_t *)tl);		\
+				(local_lock_t *)__tl);		\
 		}						\
-		!!tl;						\
+		!!__tl;						\
 	})
 
 #define __local_trylock_irqsave(lock, flags)			\
 	({							\
-		local_trylock_t *tl;				\
+		local_trylock_t *__tl;				\
 								\
 		local_irq_save(flags);				\
-		tl = (lock);					\
-		if (READ_ONCE(tl->acquired)) {			\
+		__tl = (lock);					\
+		if (READ_ONCE(__tl->acquired)) {		\
 			local_irq_restore(flags);		\
-			tl = NULL;				\
+			__tl = NULL;				\
 		} else {					\
-			WRITE_ONCE(tl->acquired, 1);		\
+			WRITE_ONCE(__tl->acquired, 1);		\
 			local_trylock_acquire(			\
-				(local_lock_t *)tl);		\
+				(local_lock_t *)__tl);		\
 		}						\
-		!!tl;						\
+		!!__tl;						\
 	})
 
 /* preemption or migration must be disabled before calling __local_lock_is_locked */
@@ -170,16 +170,16 @@ do {								\
 
 #define __local_lock_release(lock)					\
 	do {								\
-		local_trylock_t *tl;					\
-		local_lock_t *l;					\
+		local_trylock_t *__tl;					\
+		local_lock_t *__l;					\
 									\
-		l = (local_lock_t *)(lock);				\
-		tl = (local_trylock_t *)l;				\
-		local_lock_release(l);					\
+		__l = (local_lock_t *)(lock);				\
+		__tl = (local_trylock_t *)__l;				\
+		local_lock_release(__l);				\
 		_Generic((lock),					\
 			local_trylock_t *: ({				\
-				lockdep_assert(tl->acquired == 1);	\
-				WRITE_ONCE(tl->acquired, 0);		\
+				lockdep_assert(__tl->acquired == 1);	\
+				WRITE_ONCE(__tl->acquired, 0);		\
 			}),						\
 			local_lock_t *: (void)0);			\
 	} while (0)
@@ -223,12 +223,12 @@ typedef spinlock_t local_trylock_t;
 #define INIT_LOCAL_LOCK(lockname) __LOCAL_SPIN_LOCK_UNLOCKED((lockname))
 #define INIT_LOCAL_TRYLOCK(lockname) __LOCAL_SPIN_LOCK_UNLOCKED((lockname))
 
-#define __local_lock_init(l)					\
+#define __local_lock_init(__l)					\
 	do {							\
-		local_spin_lock_init((l));			\
+		local_spin_lock_init((__l));			\
 	} while (0)
 
-#define __local_trylock_init(l)			__local_lock_init(l)
+#define __local_trylock_init(__l)			__local_lock_init(__l)
 
 #define __local_lock(__lock)					\
 	do {							\
-- 
2.51.0


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

* Re: [PATCH v3 RESEND 0/2] locking/local_lock: shadowing and maintainers entry
  2025-11-27 14:41 [PATCH v3 RESEND 0/2] locking/local_lock: shadowing and maintainers entry Sebastian Andrzej Siewior
  2025-11-27 14:41 ` [PATCH 1/2] locking: Add local_locks to MAINTAINERS Sebastian Andrzej Siewior
  2025-11-27 14:41 ` [PATCH 2/2] locking/local_lock: s/l/__l/ and s/tl/__tl/ to reduce risk of shadowing Sebastian Andrzej Siewior
@ 2025-11-28 10:04 ` Peter Zijlstra
  2 siblings, 0 replies; 8+ messages in thread
From: Peter Zijlstra @ 2025-11-28 10:04 UTC (permalink / raw)
  To: Sebastian Andrzej Siewior
  Cc: linux-kernel, linux-rt-devel, tglx, Ingo Molnar, Will Deacon,
	Waiman Long

On Thu, Nov 27, 2025 at 03:41:38PM +0100, Sebastian Andrzej Siewior wrote:
> This is a repost of two individual postings earlier:
> 	https://lore.kernel.org/all/20250927090110.t8Tm9yrk@linutronix.de/	
> 	https://lore.kernel.org/all/20251009103900.2Fk8stnM@linutronix.de/
> 
> Sebastian Andrzej Siewior (1):
>   locking: Add local_locks to MAINTAINERS
> 
> Vincent Mailhol (1):
>   locking/local_lock: s/l/__l/ and s/tl/__tl/ to reduce risk of
>     shadowing
> 
>  MAINTAINERS                         |  1 +
>  include/linux/local_lock_internal.h | 62 ++++++++++++++---------------
>  2 files changed, 32 insertions(+), 31 deletions(-)

Thanks, stuck in queue/locking/core.

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

* [tip: locking/core] locking/local_lock: s/l/__l/ and s/tl/__tl/ to reduce risk of shadowing
  2025-11-27 14:41 ` [PATCH 2/2] locking/local_lock: s/l/__l/ and s/tl/__tl/ to reduce risk of shadowing Sebastian Andrzej Siewior
@ 2025-11-29 11:49   ` tip-bot2 for Vincent Mailhol
  2025-12-01  6:01   ` [tip: locking/core] locking/local_lock: s/l/__l/ and s/tl/__tl/ to reduce the " tip-bot2 for Vincent Mailhol
  1 sibling, 0 replies; 8+ messages in thread
From: tip-bot2 for Vincent Mailhol @ 2025-11-29 11:49 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Vincent Mailhol, Sebastian Andrzej Siewior,
	Peter Zijlstra (Intel),
	Waiman Long, x86, linux-kernel

The following commit has been merged into the locking/core branch of tip:

Commit-ID:     4b9405200ced4d5c90d3dfe61036833ed6fb439c
Gitweb:        https://git.kernel.org/tip/4b9405200ced4d5c90d3dfe61036833ed6fb439c
Author:        Vincent Mailhol <mailhol@kernel.org>
AuthorDate:    Thu, 27 Nov 2025 15:41:40 +01:00
Committer:     Peter Zijlstra <peterz@infradead.org>
CommitterDate: Fri, 28 Nov 2025 11:09:02 +01:00

locking/local_lock: s/l/__l/ and s/tl/__tl/ to reduce risk of shadowing

The Linux kernel coding style advises to avoid common variable
names in function-like macros to reduce the risk of collisions.

Throughout local_lock_internal.h, several macros use the rather common
variable names 'l' and 'tl'. This already resulted in an actual
collision: the __local_lock_acquire() function like macro is currently
shadowing the parameter 'l' of the:

  class_##_name##_t class_##_name##_constructor(_type *l)

function factory from linux/cleanup.h.

Rename the variable 'l' to '__l' and the variable 'tl' to '__tl'
throughout the file to fix the current name collision and to prevent
future ones.

[ bigeasy: Rebase, update all l and tl instances in macros ]

Signed-off-by: Vincent Mailhol <mailhol@kernel.org>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Waiman Long <longman@redhat.com>
Link: https://patch.msgid.link/20251127144140.215722-3-bigeasy@linutronix.de
---
 include/linux/local_lock_internal.h | 62 ++++++++++++++--------------
 1 file changed, 31 insertions(+), 31 deletions(-)

diff --git a/include/linux/local_lock_internal.h b/include/linux/local_lock_internal.h
index a4dc479..8f82b4e 100644
--- a/include/linux/local_lock_internal.h
+++ b/include/linux/local_lock_internal.h
@@ -99,18 +99,18 @@ do {								\
 
 #define __local_lock_acquire(lock)					\
 	do {								\
-		local_trylock_t *tl;					\
-		local_lock_t *l;					\
+		local_trylock_t *__tl;					\
+		local_lock_t *__l;					\
 									\
-		l = (local_lock_t *)(lock);				\
-		tl = (local_trylock_t *)l;				\
+		__l = (local_lock_t *)(lock);				\
+		__tl = (local_trylock_t *)__l;				\
 		_Generic((lock),					\
 			local_trylock_t *: ({				\
-				lockdep_assert(tl->acquired == 0);	\
-				WRITE_ONCE(tl->acquired, 1);		\
+				lockdep_assert(__tl->acquired == 0);	\
+				WRITE_ONCE(__tl->acquired, 1);		\
 			}),						\
 			local_lock_t *: (void)0);			\
-		local_lock_acquire(l);					\
+		local_lock_acquire(__l);				\
 	} while (0)
 
 #define __local_lock(lock)					\
@@ -133,36 +133,36 @@ do {								\
 
 #define __local_trylock(lock)					\
 	({							\
-		local_trylock_t *tl;				\
+		local_trylock_t *__tl;				\
 								\
 		preempt_disable();				\
-		tl = (lock);					\
-		if (READ_ONCE(tl->acquired)) {			\
+		__tl = (lock);					\
+		if (READ_ONCE(__tl->acquired)) {		\
 			preempt_enable();			\
-			tl = NULL;				\
+			__tl = NULL;				\
 		} else {					\
-			WRITE_ONCE(tl->acquired, 1);		\
+			WRITE_ONCE(__tl->acquired, 1);		\
 			local_trylock_acquire(			\
-				(local_lock_t *)tl);		\
+				(local_lock_t *)__tl);		\
 		}						\
-		!!tl;						\
+		!!__tl;						\
 	})
 
 #define __local_trylock_irqsave(lock, flags)			\
 	({							\
-		local_trylock_t *tl;				\
+		local_trylock_t *__tl;				\
 								\
 		local_irq_save(flags);				\
-		tl = (lock);					\
-		if (READ_ONCE(tl->acquired)) {			\
+		__tl = (lock);					\
+		if (READ_ONCE(__tl->acquired)) {		\
 			local_irq_restore(flags);		\
-			tl = NULL;				\
+			__tl = NULL;				\
 		} else {					\
-			WRITE_ONCE(tl->acquired, 1);		\
+			WRITE_ONCE(__tl->acquired, 1);		\
 			local_trylock_acquire(			\
-				(local_lock_t *)tl);		\
+				(local_lock_t *)__tl);		\
 		}						\
-		!!tl;						\
+		!!__tl;						\
 	})
 
 /* preemption or migration must be disabled before calling __local_lock_is_locked */
@@ -170,16 +170,16 @@ do {								\
 
 #define __local_lock_release(lock)					\
 	do {								\
-		local_trylock_t *tl;					\
-		local_lock_t *l;					\
+		local_trylock_t *__tl;					\
+		local_lock_t *__l;					\
 									\
-		l = (local_lock_t *)(lock);				\
-		tl = (local_trylock_t *)l;				\
-		local_lock_release(l);					\
+		__l = (local_lock_t *)(lock);				\
+		__tl = (local_trylock_t *)__l;				\
+		local_lock_release(__l);				\
 		_Generic((lock),					\
 			local_trylock_t *: ({				\
-				lockdep_assert(tl->acquired == 1);	\
-				WRITE_ONCE(tl->acquired, 0);		\
+				lockdep_assert(__tl->acquired == 1);	\
+				WRITE_ONCE(__tl->acquired, 0);		\
 			}),						\
 			local_lock_t *: (void)0);			\
 	} while (0)
@@ -223,12 +223,12 @@ typedef spinlock_t local_trylock_t;
 #define INIT_LOCAL_LOCK(lockname) __LOCAL_SPIN_LOCK_UNLOCKED((lockname))
 #define INIT_LOCAL_TRYLOCK(lockname) __LOCAL_SPIN_LOCK_UNLOCKED((lockname))
 
-#define __local_lock_init(l)					\
+#define __local_lock_init(__l)					\
 	do {							\
-		local_spin_lock_init((l));			\
+		local_spin_lock_init((__l));			\
 	} while (0)
 
-#define __local_trylock_init(l)			__local_lock_init(l)
+#define __local_trylock_init(__l)			__local_lock_init(__l)
 
 #define __local_lock(__lock)					\
 	do {							\

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

* [tip: locking/core] locking: Add local_locks to MAINTAINERS
  2025-11-27 14:41 ` [PATCH 1/2] locking: Add local_locks to MAINTAINERS Sebastian Andrzej Siewior
@ 2025-11-29 11:49   ` tip-bot2 for Sebastian Andrzej Siewior
  2025-12-01  6:01   ` [tip: locking/core] locking/local_lock: Add the <linux/local_lock*.h> headers " tip-bot2 for Sebastian Andrzej Siewior
  1 sibling, 0 replies; 8+ messages in thread
From: tip-bot2 for Sebastian Andrzej Siewior @ 2025-11-29 11:49 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Sebastian Andrzej Siewior, Peter Zijlstra (Intel),
	Waiman Long, x86, linux-kernel

The following commit has been merged into the locking/core branch of tip:

Commit-ID:     477ee187604d2169f52e570dc04dadb33ea78c59
Gitweb:        https://git.kernel.org/tip/477ee187604d2169f52e570dc04dadb33ea78c59
Author:        Sebastian Andrzej Siewior <bigeasy@linutronix.de>
AuthorDate:    Thu, 27 Nov 2025 15:41:39 +01:00
Committer:     Peter Zijlstra <peterz@infradead.org>
CommitterDate: Fri, 28 Nov 2025 11:09:01 +01:00

locking: Add local_locks to MAINTAINERS

The local_lock_t was never added to the MAINTAINERS file since its
inclusion.

Add local_lock_t to the locking primitives section.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Waiman Long <longman@redhat.com>
Link: https://patch.msgid.link/20251127144140.215722-2-bigeasy@linutronix.de
---
 MAINTAINERS | 1 +
 1 file changed, 1 insertion(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 545a477..a099b9b 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -14517,6 +14517,7 @@ S:	Maintained
 T:	git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git locking/core
 F:	Documentation/locking/
 F:	arch/*/include/asm/spinlock*.h
+F:	include/linux/local_lock*.h
 F:	include/linux/lockdep*.h
 F:	include/linux/mutex*.h
 F:	include/linux/rwlock*.h

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

* [tip: locking/core] locking/local_lock: s/l/__l/ and s/tl/__tl/ to reduce the risk of shadowing
  2025-11-27 14:41 ` [PATCH 2/2] locking/local_lock: s/l/__l/ and s/tl/__tl/ to reduce risk of shadowing Sebastian Andrzej Siewior
  2025-11-29 11:49   ` [tip: locking/core] " tip-bot2 for Vincent Mailhol
@ 2025-12-01  6:01   ` tip-bot2 for Vincent Mailhol
  1 sibling, 0 replies; 8+ messages in thread
From: tip-bot2 for Vincent Mailhol @ 2025-12-01  6:01 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Vincent Mailhol, Sebastian Andrzej Siewior,
	Peter Zijlstra (Intel),
	Ingo Molnar, Waiman Long, x86, linux-kernel

The following commit has been merged into the locking/core branch of tip:

Commit-ID:     719e357fc09c63238956eb7cd546627f9e050640
Gitweb:        https://git.kernel.org/tip/719e357fc09c63238956eb7cd546627f9e050640
Author:        Vincent Mailhol <mailhol@kernel.org>
AuthorDate:    Thu, 27 Nov 2025 15:41:40 +01:00
Committer:     Ingo Molnar <mingo@kernel.org>
CommitterDate: Mon, 01 Dec 2025 06:56:16 +01:00

locking/local_lock: s/l/__l/ and s/tl/__tl/ to reduce the risk of shadowing

The Linux kernel coding style advises to avoid common variable
names in function-like macros to reduce the risk of namespace
collisions.

Throughout local_lock_internal.h, several macros use the rather common
variable names 'l' and 'tl'. This already resulted in an actual
collision: the __local_lock_acquire() function like macro is currently
shadowing the parameter 'l' of the:

  class_##_name##_t class_##_name##_constructor(_type *l)

function factory from <linux/cleanup.h>.

Rename the variable 'l' to '__l' and the variable 'tl' to '__tl'
throughout the file to fix the current namespace collision and
to prevent future ones.

[ bigeasy: Rebase, update all l and tl instances in macros ]

Signed-off-by: Vincent Mailhol <mailhol@kernel.org>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Waiman Long <longman@redhat.com>
Link: https://patch.msgid.link/20251127144140.215722-3-bigeasy@linutronix.de
---
 include/linux/local_lock_internal.h | 62 ++++++++++++++--------------
 1 file changed, 31 insertions(+), 31 deletions(-)

diff --git a/include/linux/local_lock_internal.h b/include/linux/local_lock_internal.h
index a4dc479..8f82b4e 100644
--- a/include/linux/local_lock_internal.h
+++ b/include/linux/local_lock_internal.h
@@ -99,18 +99,18 @@ do {								\
 
 #define __local_lock_acquire(lock)					\
 	do {								\
-		local_trylock_t *tl;					\
-		local_lock_t *l;					\
+		local_trylock_t *__tl;					\
+		local_lock_t *__l;					\
 									\
-		l = (local_lock_t *)(lock);				\
-		tl = (local_trylock_t *)l;				\
+		__l = (local_lock_t *)(lock);				\
+		__tl = (local_trylock_t *)__l;				\
 		_Generic((lock),					\
 			local_trylock_t *: ({				\
-				lockdep_assert(tl->acquired == 0);	\
-				WRITE_ONCE(tl->acquired, 1);		\
+				lockdep_assert(__tl->acquired == 0);	\
+				WRITE_ONCE(__tl->acquired, 1);		\
 			}),						\
 			local_lock_t *: (void)0);			\
-		local_lock_acquire(l);					\
+		local_lock_acquire(__l);				\
 	} while (0)
 
 #define __local_lock(lock)					\
@@ -133,36 +133,36 @@ do {								\
 
 #define __local_trylock(lock)					\
 	({							\
-		local_trylock_t *tl;				\
+		local_trylock_t *__tl;				\
 								\
 		preempt_disable();				\
-		tl = (lock);					\
-		if (READ_ONCE(tl->acquired)) {			\
+		__tl = (lock);					\
+		if (READ_ONCE(__tl->acquired)) {		\
 			preempt_enable();			\
-			tl = NULL;				\
+			__tl = NULL;				\
 		} else {					\
-			WRITE_ONCE(tl->acquired, 1);		\
+			WRITE_ONCE(__tl->acquired, 1);		\
 			local_trylock_acquire(			\
-				(local_lock_t *)tl);		\
+				(local_lock_t *)__tl);		\
 		}						\
-		!!tl;						\
+		!!__tl;						\
 	})
 
 #define __local_trylock_irqsave(lock, flags)			\
 	({							\
-		local_trylock_t *tl;				\
+		local_trylock_t *__tl;				\
 								\
 		local_irq_save(flags);				\
-		tl = (lock);					\
-		if (READ_ONCE(tl->acquired)) {			\
+		__tl = (lock);					\
+		if (READ_ONCE(__tl->acquired)) {		\
 			local_irq_restore(flags);		\
-			tl = NULL;				\
+			__tl = NULL;				\
 		} else {					\
-			WRITE_ONCE(tl->acquired, 1);		\
+			WRITE_ONCE(__tl->acquired, 1);		\
 			local_trylock_acquire(			\
-				(local_lock_t *)tl);		\
+				(local_lock_t *)__tl);		\
 		}						\
-		!!tl;						\
+		!!__tl;						\
 	})
 
 /* preemption or migration must be disabled before calling __local_lock_is_locked */
@@ -170,16 +170,16 @@ do {								\
 
 #define __local_lock_release(lock)					\
 	do {								\
-		local_trylock_t *tl;					\
-		local_lock_t *l;					\
+		local_trylock_t *__tl;					\
+		local_lock_t *__l;					\
 									\
-		l = (local_lock_t *)(lock);				\
-		tl = (local_trylock_t *)l;				\
-		local_lock_release(l);					\
+		__l = (local_lock_t *)(lock);				\
+		__tl = (local_trylock_t *)__l;				\
+		local_lock_release(__l);				\
 		_Generic((lock),					\
 			local_trylock_t *: ({				\
-				lockdep_assert(tl->acquired == 1);	\
-				WRITE_ONCE(tl->acquired, 0);		\
+				lockdep_assert(__tl->acquired == 1);	\
+				WRITE_ONCE(__tl->acquired, 0);		\
 			}),						\
 			local_lock_t *: (void)0);			\
 	} while (0)
@@ -223,12 +223,12 @@ typedef spinlock_t local_trylock_t;
 #define INIT_LOCAL_LOCK(lockname) __LOCAL_SPIN_LOCK_UNLOCKED((lockname))
 #define INIT_LOCAL_TRYLOCK(lockname) __LOCAL_SPIN_LOCK_UNLOCKED((lockname))
 
-#define __local_lock_init(l)					\
+#define __local_lock_init(__l)					\
 	do {							\
-		local_spin_lock_init((l));			\
+		local_spin_lock_init((__l));			\
 	} while (0)
 
-#define __local_trylock_init(l)			__local_lock_init(l)
+#define __local_trylock_init(__l)			__local_lock_init(__l)
 
 #define __local_lock(__lock)					\
 	do {							\

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

* [tip: locking/core] locking/local_lock: Add the <linux/local_lock*.h> headers to MAINTAINERS
  2025-11-27 14:41 ` [PATCH 1/2] locking: Add local_locks to MAINTAINERS Sebastian Andrzej Siewior
  2025-11-29 11:49   ` [tip: locking/core] " tip-bot2 for Sebastian Andrzej Siewior
@ 2025-12-01  6:01   ` tip-bot2 for Sebastian Andrzej Siewior
  1 sibling, 0 replies; 8+ messages in thread
From: tip-bot2 for Sebastian Andrzej Siewior @ 2025-12-01  6:01 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Sebastian Andrzej Siewior, Peter Zijlstra (Intel),
	Ingo Molnar, Waiman Long, x86, linux-kernel

The following commit has been merged into the locking/core branch of tip:

Commit-ID:     52ed746147140e30419ee852c1916531b4ef9b0a
Gitweb:        https://git.kernel.org/tip/52ed746147140e30419ee852c1916531b4ef9b0a
Author:        Sebastian Andrzej Siewior <bigeasy@linutronix.de>
AuthorDate:    Thu, 27 Nov 2025 15:41:39 +01:00
Committer:     Ingo Molnar <mingo@kernel.org>
CommitterDate: Mon, 01 Dec 2025 06:56:10 +01:00

locking/local_lock: Add the <linux/local_lock*.h> headers to MAINTAINERS

The local_lock_t was never added to the MAINTAINERS file since its
inclusion.

Add local_lock_t to the locking primitives section.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Waiman Long <longman@redhat.com>
Link: https://patch.msgid.link/20251127144140.215722-2-bigeasy@linutronix.de
---
 MAINTAINERS | 1 +
 1 file changed, 1 insertion(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 545a477..a099b9b 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -14517,6 +14517,7 @@ S:	Maintained
 T:	git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git locking/core
 F:	Documentation/locking/
 F:	arch/*/include/asm/spinlock*.h
+F:	include/linux/local_lock*.h
 F:	include/linux/lockdep*.h
 F:	include/linux/mutex*.h
 F:	include/linux/rwlock*.h

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

end of thread, other threads:[~2025-12-01  6:01 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-11-27 14:41 [PATCH v3 RESEND 0/2] locking/local_lock: shadowing and maintainers entry Sebastian Andrzej Siewior
2025-11-27 14:41 ` [PATCH 1/2] locking: Add local_locks to MAINTAINERS Sebastian Andrzej Siewior
2025-11-29 11:49   ` [tip: locking/core] " tip-bot2 for Sebastian Andrzej Siewior
2025-12-01  6:01   ` [tip: locking/core] locking/local_lock: Add the <linux/local_lock*.h> headers " tip-bot2 for Sebastian Andrzej Siewior
2025-11-27 14:41 ` [PATCH 2/2] locking/local_lock: s/l/__l/ and s/tl/__tl/ to reduce risk of shadowing Sebastian Andrzej Siewior
2025-11-29 11:49   ` [tip: locking/core] " tip-bot2 for Vincent Mailhol
2025-12-01  6:01   ` [tip: locking/core] locking/local_lock: s/l/__l/ and s/tl/__tl/ to reduce the " tip-bot2 for Vincent Mailhol
2025-11-28 10:04 ` [PATCH v3 RESEND 0/2] locking/local_lock: shadowing and maintainers entry Peter Zijlstra

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

all inboxes | Powered by JetHome®