From: Petr Mladek <pmladek@suse.com>
To: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Intel Graphics Development <intel-gfx@lists.freedesktop.org>,
Daniel Vetter <daniel.vetter@intel.com>,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>, Will Deacon <will.deacon@arm.com>,
Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
Steven Rostedt <rostedt@goodmis.org>,
John Ogness <john.ogness@linutronix.de>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] RFC: console: hack up console_lock more v2
Date: Mon, 6 May 2019 10:16:14 +0200 [thread overview]
Message-ID: <20190506081614.b7b22k4prodskbiy@pathway.suse.cz> (raw)
In-Reply-To: <20190506074553.21464-1-daniel.vetter@ffwll.ch>
On Mon 2019-05-06 09:45:53, Daniel Vetter wrote:
> console_trylock, called from within printk, can be called from pretty
> much anywhere. Including try_to_wake_up. Note that this isn't common,
> usually the box is in pretty bad shape at that point already. But it
> really doesn't help when then lockdep jumps in and spams the logs,
> potentially obscuring the real backtrace we're really interested in.
> One case I've seen (slightly simplified backtrace):
>
> Call Trace:
> <IRQ>
> console_trylock+0xe/0x60
> vprintk_emit+0xf1/0x320
> printk+0x4d/0x69
> __warn_printk+0x46/0x90
> native_smp_send_reschedule+0x2f/0x40
> check_preempt_curr+0x81/0xa0
> ttwu_do_wakeup+0x14/0x220
> try_to_wake_up+0x218/0x5f0
try_to_wake_up() takes p->pi_lock. It could deadlock because it
can get called recursively from printk_safe_up().
And there are more locks taken from try_to_wake_up(), for example,
__task_rq_lock() taken from ttwu_remote().
IMHO, the most reliable solution would be do call the entire
up_console_sem() from printk deferred context. We could assign
few bytes for this context in the per-CPU printk_deferred
variable.
Best Regards,
Petr
next prev parent reply other threads:[~2019-05-06 8:16 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-02 14:16 [PATCH] RFC: console: hack up console_trylock more Daniel Vetter
2019-05-03 15:14 ` Petr Mladek
2019-05-06 7:11 ` Daniel Vetter
2019-05-06 7:48 ` Petr Mladek
2019-05-06 8:40 ` Daniel Vetter
2019-05-06 7:45 ` [PATCH] RFC: console: hack up console_lock more v2 Daniel Vetter
2019-05-06 8:16 ` Petr Mladek [this message]
2019-05-06 8:26 ` Petr Mladek
2019-05-06 9:38 ` Daniel Vetter
2019-05-06 11:24 ` Petr Mladek
2019-05-08 8:17 ` [Intel-gfx] " Daniel Vetter
2019-05-09 15:08 ` Petr Mladek
2019-05-06 8:20 ` Petr Mladek
2019-05-09 10:32 ` [Intel-gfx] " Chris Wilson
2019-05-09 13:05 ` 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=20190506081614.b7b22k4prodskbiy@pathway.suse.cz \
--to=pmladek@suse.com \
--cc=daniel.vetter@ffwll.ch \
--cc=daniel.vetter@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=john.ogness@linutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=sergey.senozhatsky@gmail.com \
--cc=will.deacon@arm.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®