[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJuCfpEbRJ7vrptiC_NxSO_4U=mShZoiN+LdX8j5=rPux4cgdQ@mail.gmail.com>
Date: Wed, 4 Jun 2025 07:29:44 -0700
From: Suren Baghdasaryan <surenb@...gle.com>
To: John Ogness <john.ogness@...utronix.de>
Cc: Vlastimil Babka <vbabka@...e.cz>,
syzbot <syzbot+23de6daeb71241d36a18@...kaller.appspotmail.com>,
Liam.Howlett@...cle.com, akpm@...ux-foundation.org, jannh@...gle.com,
linux-kernel@...r.kernel.org, linux-mm@...ck.org, lorenzo.stoakes@...cle.com,
pfalcato@...e.de, syzkaller-bugs@...glegroups.com,
Peter Zijlstra <peterz@...radead.org>, Petr Mladek <pmladek@...e.com>
Subject: Re: [syzbot] [mm?] possible deadlock in __vma_start_write
On Wed, Jun 4, 2025 at 1:31 AM John Ogness <john.ogness@...utronix.de> wrote:
>
> On 2025-06-04, Vlastimil Babka <vbabka@...e.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.
Thanks for additional info, folks! I'll look into it some more to see
if the chain can be broken somehow but most likely will have to live
with it for now.
Cheers,
Suren.
>
> John
>
> [0] https://lore.kernel.org/lkml/20240603232453.33992-17-john.ogness@linutronix.de
Powered by blists - more mailing lists