public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Petr Mladek <pmladek@suse.com>
To: Andrew Murray <amurray@thegoodpenguin.co.uk>
Cc: Steven Rostedt <rostedt@goodmis.org>,
	John Ogness <john.ogness@linutronix.de>,
	Sergey Senozhatsky <senozhatsky@chromium.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 0/3] printk: Release console_lock between printing records in legacy thread
Date: Thu, 23 Oct 2025 17:38:39 +0200	[thread overview]
Message-ID: <aPpL_9hyzLPIBYTQ@pathway.suse.cz> (raw)
In-Reply-To: <20251020-printk_legacy_thread_console_lock-v3-0-00f1f0ac055a@thegoodpenguin.co.uk>

On Mon 2025-10-20 16:38:04, Andrew Murray wrote:
> The legacy printer kthread uses console_lock and
> __console_flush_and_unlock to flush records to the console which
> holds the console_lock being held for the entire flush. This
> results in large waiting times for console_lock waiters
> especially where there is a large volume of records or where the
> console is slow (e.g. serial). During boot, this contention causes
> delays in the filp_open call in console_on_rootfs.
>    
> Let's instead release and reacquire console_lock in between
> printing individual records.
> 
> Signed-off-by: Andrew Murray <amurray@thegoodpenguin.co.uk>
> ---
> Changes in v3:
> - Rebased on v6.18-rc2
> - Reordering of variables and minor tweak to comments in console_flush_one_record
>   in first patch
> - Improve semantics of console_flush_one_record in the second patch through different
>   use of return value and by replacing any_usable with try_again.
> - Update third patch to use newer version of console_flush_one_record
> - Link to v2: https://lore.kernel.org/r/20250927-printk_legacy_thread_console_lock-v2-0-cff9f063071a@thegoodpenguin.co.uk
> 
> Changes in v2:
> - Move any_usable=false to console_flush_all in the 'introduce
>   console_flush_one_record' patch to match original implementation.
> - Add Petr's console_flush_one_record() code cleanup patch
> - Open code flushing implementation in legacy_kthread_func instead
>   of introducing new console_flush functions.
> - Link to v1: https://lore.kernel.org/r/20250915-printk_legacy_thread_console_lock-v1-0-f34d42a9bcb3@thegoodpenguin.co.uk
> 
> ---
> Andrew Murray (2):
>       printk: Introduce console_flush_one_record
>       printk: Use console_flush_one_record for legacy printer kthread
> 
> Petr Mladek (1):
>       printk: console_flush_one_record() code cleanup
> 
>  kernel/printk/printk.c | 186 +++++++++++++++++++++++++++++++------------------
>  1 file changed, 119 insertions(+), 67 deletions(-)
> ---
> base-commit: 211ddde0823f1442e4ad052a2f30f050145ccada
> change-id: 20250914-printk_legacy_thread_console_lock-1c27f59bf990

JFYI, the patchset has been committed into printk/linux.git,
branch rework/preempt-legacy-kthread. It is intended for 6.19.

Best Regards,
Petr

      parent reply	other threads:[~2025-10-23 15:38 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-20 15:38 [PATCH v3 0/3] printk: Release console_lock between printing records in legacy thread Andrew Murray
2025-10-20 15:38 ` [PATCH v3 1/3] printk: Introduce console_flush_one_record Andrew Murray
2025-10-23 13:17   ` John Ogness
2025-10-20 15:38 ` [PATCH v3 2/3] printk: console_flush_one_record() code cleanup Andrew Murray
2025-10-23 13:18   ` John Ogness
2025-10-23 14:54     ` Petr Mladek
2025-10-23 15:21       ` Andrew Murray
2025-10-20 15:38 ` [PATCH v3 3/3] printk: Use console_flush_one_record for legacy printer kthread Andrew Murray
2025-10-23 13:19   ` John Ogness
2025-10-23 14:56     ` Petr Mladek
2025-10-23 15:21       ` Andrew Murray
2025-10-23 15:38 ` Petr Mladek [this message]

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=aPpL_9hyzLPIBYTQ@pathway.suse.cz \
    --to=pmladek@suse.com \
    --cc=amurray@thegoodpenguin.co.uk \
    --cc=john.ogness@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --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