public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3] printk: Release console_lock between printing records in legacy thread
@ 2025-09-27 22:05 Andrew Murray
  2025-09-27 22:05 ` [PATCH v2 1/3] printk: Introduce console_flush_one_record Andrew Murray
                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Andrew Murray @ 2025-09-27 22:05 UTC (permalink / raw)
  To: Petr Mladek, Steven Rostedt, John Ogness, Sergey Senozhatsky
  Cc: linux-kernel, Andrew Murray

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 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: f83ec76bf285bea5727f478a68b894f5543ca76e
change-id: 20250914-printk_legacy_thread_console_lock-1c27f59bf990

Best regards,
-- 
Andrew Murray <amurray@thegoodpenguin.co.uk>


^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2025-10-08 16:15 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-27 22:05 [PATCH v2 0/3] printk: Release console_lock between printing records in legacy thread Andrew Murray
2025-09-27 22:05 ` [PATCH v2 1/3] printk: Introduce console_flush_one_record Andrew Murray
2025-09-30 12:54   ` John Ogness
2025-09-30 13:21     ` Andrew Murray
2025-10-03 13:29   ` Petr Mladek
2025-09-27 22:05 ` [PATCH v2 2/3] printk: console_flush_one_record() code cleanup Andrew Murray
2025-09-30 12:59   ` John Ogness
2025-09-30 15:14     ` Andrew Murray
2025-10-01  9:53       ` John Ogness
2025-10-01 16:26         ` Andrew Murray
2025-10-02 10:10           ` Petr Mladek
2025-10-03 16:19             ` Petr Mladek
2025-10-08 16:06               ` John Ogness
2025-09-27 22:05 ` [PATCH v2 3/3] printk: Use console_flush_one_record for legacy printer kthread Andrew Murray
2025-09-30 13:03   ` John Ogness
2025-09-30 13:20     ` Andrew Murray
2025-10-03 16:26   ` Petr Mladek
2025-10-08 16:15     ` John Ogness

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox