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]
Message-ID: <20251023151112.goqBFQcM@linutronix.de>
Date: Thu, 23 Oct 2025 17:11:12 +0200
From: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
To: John Ogness <john.ogness@...utronix.de>
Cc: Oleg Nesterov <oleg@...hat.com>, Petr Mladek <pmladek@...e.com>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] printk_legacy_map: use LD_WAIT_CONFIG instead of
 LD_WAIT_SLEEP

On 2025-10-23 17:12:49 [+0206], John Ogness wrote:
> On 2025-10-23, Sebastian Andrzej Siewior <bigeasy@...utronix.de> wrote:
> >> @@ -3016,7 +3017,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);
> >
> > We could use this lock_map_acquire_try() directly but okay having it in
> > one spot with a comment might have its benefit. But _why_ is here a
> > CONFIG_PREEMPT_RT? This is supposed to work in both cases. Should a
> > legacy driver be invoked on RT then the comment is not accurate, lockdep
> > won't yell but we still have CONFIG_DEBUG_ATOMIC_SLEEP making its own
> > judgement.
> 
> With PREEMPT_RT, legacy console printing is forced into its own
> dedicated kthread. At runtime this is checked via
> force_legacy_kthread(). So with PREEMPT_RT there is no need for special
> lockdep trickery. Once we can get all the consoles switched over to
> nbcon, !PREEMPT_RT will also not need this lockdep trickery.

This does not matter. My point is that there no need for this ifdefery.
You say: This might get the nesting wrong but it is fine because the
outer lock should be this. This does not hurt if it is also applied on
RT. _BUT_ on RT you don't even trigger this path so this ifdef is not
needed.

> John

Sebastian

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ