From: John Ogness <john.ogness@linutronix.de>
To: Petr Mladek <pmladek@suse.com>,
Andrew Murray <amurray@thegoodpenguin.co.uk>
Cc: senozhatsky@chromium.org, rostedt@goodmis.org,
linux-serial@vger.kernel.org,
Michael Cobb <mcobb@thegoodpenguin.co.uk>
Subject: Re: Lock contention with console kthreads
Date: Wed, 10 Sep 2025 11:45:06 +0206 [thread overview]
Message-ID: <84a5326405.fsf@jogness.linutronix.de> (raw)
In-Reply-To: <aMFBWJWqv3KsaaZU@pathway.suse.cz>
On 2025-09-10, Petr Mladek <pmladek@suse.com> wrote:
>> Since commit 5f53ca3ff83b ("printk: Implement legacy printer kthread
>> for PREEMPT_RT"), and only when PREEMPT_RT is enabled, legacy consoles
>> use a kthread to write out to the device. This is beneficial for boot
>> time when using a slow console such as a serial port. However, this
>> gain can be short-lived as console_on_rootfs in init/main.c appears to
>> act as a synchronisation point.
>>
>> legacy_kthread_func holds console_lock when flushing, and is held for
>> a long period of time during boot.
[...]
> I would suggest to modify legacy_kthread_func() and flush one
> record-per-cycle and get/release the console_lock() in each cycle.
Agreed. This is an excellent suggestion!
John
next prev parent reply other threads:[~2025-09-10 9:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-09 20:14 Lock contention with console kthreads Andrew Murray
2025-09-10 9:14 ` Petr Mladek
2025-09-10 9:39 ` John Ogness [this message]
2025-09-11 10:12 ` Andrew Murray
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=84a5326405.fsf@jogness.linutronix.de \
--to=john.ogness@linutronix.de \
--cc=amurray@thegoodpenguin.co.uk \
--cc=linux-serial@vger.kernel.org \
--cc=mcobb@thegoodpenguin.co.uk \
--cc=pmladek@suse.com \
--cc=rostedt@goodmis.org \
--cc=senozhatsky@chromium.org \
/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