linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: John Ogness <john.ogness@linutronix.de>
To: Vlastimil Babka <vbabka@suse.cz>,
	syzbot <syzbot+23de6daeb71241d36a18@syzkaller.appspotmail.com>,
	Liam.Howlett@oracle.com, akpm@linux-foundation.org,
	jannh@google.com, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org, lorenzo.stoakes@oracle.com, pfalcato@suse.de,
	syzkaller-bugs@googlegroups.com
Cc: Suren Baghdasaryan <surenb@google.com>,
	Lorenzo Stoakes <lorenzo.stoakes@oracle.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Petr Mladek <pmladek@suse.com>
Subject: Re: [syzbot] [mm?] possible deadlock in __vma_start_write
Date: Wed, 04 Jun 2025 10:37:43 +0206	[thread overview]
Message-ID: <84qzzzoqkw.fsf@jogness.linutronix.de> (raw)
In-Reply-To: <f03916ab-19fc-4832-b564-58d3c885011d@suse.cz>

On 2025-06-04, Vlastimil Babka <vbabka@suse.cz> wrote:
> After consulting PeterZ on IRC, he said:
>
>> so the thing complains about: vmlock <- mapping.invalidate_lock <- bcachefs_btree <- console_lock <- &helper->lock <- dev->mode_config.idr_mutex <- mm->mmap_lock <- vmlock
>
> so bcachefs is doing printk which wants console_lock, and in
> drm console a possible lock chain exists that can lead to mmap lock
>
> To me it seems all rather theoretical, but not sure where and how we could safely
> break this chain.
> Hopefully one day console_lock goes away? :)

It is a known problem that any caller holding a lock used by a
registered legacy console will result in printk() deadlocking. This is
particularly a problem with the port->lock and power management.

One workaround is to enable CONFIG_PREEMPT_RT. ;-)

A year ago (exactly) there was patch [0] providing a "threadprintk" boot
argument that would also work around this problem.

However, the only real solution is to convert the legacy consoles to
nbcon. This is work in progress.

John

[0] https://lore.kernel.org/lkml/20240603232453.33992-17-john.ogness@linutronix.de


  reply	other threads:[~2025-06-04  8:31 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-29 15:40 syzbot
2025-06-02 13:04 ` Lorenzo Stoakes
2025-06-02 14:16   ` Suren Baghdasaryan
2025-06-02 14:19     ` Lorenzo Stoakes
2025-06-04  0:51       ` Suren Baghdasaryan
2025-06-04  5:17         ` Lorenzo Stoakes
2025-06-04  7:52 ` Vlastimil Babka
2025-06-04  8:31   ` John Ogness [this message]
2025-06-04 14:29     ` Suren Baghdasaryan
2025-06-05  9:40   ` Petr Mladek
2025-06-05 10:48     ` Peter Zijlstra

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=84qzzzoqkw.fsf@jogness.linutronix.de \
    --to=john.ogness@linutronix.de \
    --cc=Liam.Howlett@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=jannh@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lorenzo.stoakes@oracle.com \
    --cc=peterz@infradead.org \
    --cc=pfalcato@suse.de \
    --cc=pmladek@suse.com \
    --cc=surenb@google.com \
    --cc=syzbot+23de6daeb71241d36a18@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    --cc=vbabka@suse.cz \
    /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