linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] printk_legacy_map: use LD_WAIT_CONFIG instead of LD_WAIT_SLEEP
@ 2025-10-22 15:41 Oleg Nesterov
  2025-10-23  7:49 ` Petr Mladek
                   ` (2 more replies)
  0 siblings, 3 replies; 22+ messages in thread
From: Oleg Nesterov @ 2025-10-22 15:41 UTC (permalink / raw)
  To: Andrew Morton, John Ogness, Petr Mladek,
	Sebastian Andrzej Siewior
  Cc: linux-kernel

printk_legacy_map is used on !PREEMPT_RT to avoid false positives from
CONFIG_PROVE_RAW_LOCK_NESTING about raw_spinlock/spinlock nesting.

However, LD_WAIT_SLEEP is not exactly right; it fools lockdep as if it
is fine to acquire a sleeping lock.

Change DEFINE_WAIT_OVERRIDE_MAP(printk_legacy_map) to use LD_WAIT_CONFIG.

(We can also make printk_legacy_allow_spinlock_enter/exit() depend on
 !PREEMPT_RT && CONFIG_PROVE_RAW_LOCK_NESTING)

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
---
 kernel/printk/printk.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index 5aee9ffb16b9..f11b2f31999b 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -3007,7 +3007,7 @@ bool printk_get_next_message(struct printk_message *pmsg, u64 seq,
  * false positive. For PREEMPT_RT the false positive condition does not
  * occur.
  *
- * This map is used to temporarily establish LD_WAIT_SLEEP context for the
+ * This map is used to temporarily establish LD_WAIT_CONFIG context for the
  * console write() callback when legacy printing to avoid false positive
  * lockdep complaints, thus allowing lockdep to continue to function for
  * real issues.
@@ -3016,7 +3016,7 @@ bool printk_get_next_message(struct printk_message *pmsg, u64 seq,
 static inline void printk_legacy_allow_spinlock_enter(void) { }
 static inline void printk_legacy_allow_spinlock_exit(void) { }
 #else
-static DEFINE_WAIT_OVERRIDE_MAP(printk_legacy_map, LD_WAIT_SLEEP);
+static DEFINE_WAIT_OVERRIDE_MAP(printk_legacy_map, LD_WAIT_CONFIG);
 
 static inline void printk_legacy_allow_spinlock_enter(void)
 {
-- 
2.25.1.362.g51ebf55



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

end of thread, other threads:[~2025-10-27  8:37 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-22 15:41 [PATCH] printk_legacy_map: use LD_WAIT_CONFIG instead of LD_WAIT_SLEEP Oleg Nesterov
2025-10-23  7:49 ` Petr Mladek
2025-10-23  8:58   ` John Ogness
2025-10-23 10:28     ` Oleg Nesterov
2025-10-23  9:28   ` Oleg Nesterov
2025-10-23 10:32 ` [PATCH v2] " Oleg Nesterov
2025-10-23 14:26   ` Sebastian Andrzej Siewior
2025-10-23 15:06     ` John Ogness
2025-10-23 15:11       ` Sebastian Andrzej Siewior
2025-10-23 15:46         ` John Ogness
2025-10-23 15:46         ` Oleg Nesterov
2025-10-23 19:14           ` Sebastian Andrzej Siewior
2025-10-24  9:35             ` Petr Mladek
2025-10-24 10:38               ` Sebastian Andrzej Siewior
2025-10-24 12:57                 ` Petr Mladek
2025-10-24 15:15                   ` Oleg Nesterov
2025-10-24 10:40     ` Oleg Nesterov
2025-10-24 10:52       ` Sebastian Andrzej Siewior
2025-10-24 11:00         ` Oleg Nesterov
2025-10-26 15:07 ` [PATCH v3] " Oleg Nesterov
2025-10-27  8:28   ` Sebastian Andrzej Siewior
2025-10-27  8:37   ` John Ogness

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