mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Petr Mladek <pmladek@suse.com>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Oleg Nesterov <oleg@redhat.com>,
	John Ogness <john.ogness@linutronix.de>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] printk_legacy_map: use LD_WAIT_CONFIG instead of LD_WAIT_SLEEP
Date: Fri, 24 Oct 2025 11:35:14 +0200	[thread overview]
Message-ID: <aPtIUq7hf4R5-qfF@pathway.suse.cz> (raw)
In-Reply-To: <20251023191442.Uu0mD_Nq@linutronix.de>

On Thu 2025-10-23 21:14:42, Sebastian Andrzej Siewior wrote:
> On 2025-10-23 17:46:58 [+0200], Oleg Nesterov wrote:
> > Again, quite possibly I am wrong. please see my reply in another thread,
> > https://lore.kernel.org/all/20251023152942.GC26461@redhat.com/
> > 
> > On 10/23, Sebastian Andrzej Siewior wrote:
> > >
> > > This does not matter. My point is that there no need for this ifdefery.
> > 
> > I disagree. Rightly or not. To me this ifdefery in printk.c make the intent
> > more clear.
> > 
> > I am still thinking about the possible cleanup of the current usage of
> > DEFINE_WAIT_OVERRIDE_MAP(), but I think that, whatever we do, this cleanup
> > should take CONFIG_RT into account.
> 
> Right. Please just do s/SLEEP/CONFIG as discussed. Please leave
> PROVE_RAW_LOCK_NESTING out of it while arguing why this change is
> correct.

It is clear that the commit message and the comment above the mapping
caused some confusion. I thought about better wording.

I wanted to be as clear as possible, But the problem is that everyone
has different background and might understand the same term
differently. Also I am not a native speaker.


/*
 * Some legacy console drivers might violate raw_spinlock/spinlock nesting
 * rules when printk() was called under a raw_spinlock and the driver used
 * a spinlock. It is not a real problem because the legacy drivers should
 * never be called directly from printk() in PREEMPT_RT.
 *
 * This map is used to pretend that printk() was called under a normal spinlock
 * to hide the above described locking violation. It still allows to catch
 * other problems, for example, possible ABBA deadlocks or sleeping locks.
 *
 * The mapping is not used in PREEMPT_RT which allows to catch bugs when
 * the legacy console driver would get called from an atomic context by mistake.
 */


And the commit message might be:

<commit_message>
printk_legacy_map: use LD_WAIT_CONFIG instead of LD_WAIT_SLEEP

printk_legacy_map is used to hide possible violations of
raw_spinlock/spinlock nesting when printk() calls legacy console
drivers directly. It is not a real problem in !PREEMPT_RT mode and
the problematic code path should never be called in PREEMPT_RT mode.

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.

Also, update the comment to better describe the purpose of the mapping.
</commit_message>


Is this better and acceptable, please?
If not then please provide alternatives ;-)

Best Regards,
Petr

  reply	other threads:[~2025-10-24  9:35 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-22 15:41 [PATCH] " 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 [this message]
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
2025-10-29 13:15   ` Petr Mladek
2025-10-29 17:00   ` Petr Mladek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aPtIUq7hf4R5-qfF@pathway.suse.cz \
    --to=pmladek@suse.com \
    --cc=bigeasy@linutronix.de \
    --cc=john.ogness@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oleg@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®