summaryrefslogtreecommitdiffstats
path: root/debian/patches-rt/0105-printk-move-console-printing-to-kthreads.patch
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches-rt/0105-printk-move-console-printing-to-kthreads.patch')
-rw-r--r--debian/patches-rt/0105-printk-move-console-printing-to-kthreads.patch56
1 files changed, 31 insertions, 25 deletions
diff --git a/debian/patches-rt/0105-printk-move-console-printing-to-kthreads.patch b/debian/patches-rt/0105-printk-move-console-printing-to-kthreads.patch
index 5f6075baf..47db87d2b 100644
--- a/debian/patches-rt/0105-printk-move-console-printing-to-kthreads.patch
+++ b/debian/patches-rt/0105-printk-move-console-printing-to-kthreads.patch
@@ -1,8 +1,8 @@
-From 24c419661c9c605b6f1ddccf1683c2c0f8c5dcf4 Mon Sep 17 00:00:00 2001
+From f2b6a7c9bcafbbfeeccaddeb86c2f7107a245442 Mon Sep 17 00:00:00 2001
From: John Ogness <john.ogness@linutronix.de>
Date: Mon, 30 Nov 2020 01:42:07 +0106
Subject: [PATCH 105/323] printk: move console printing to kthreads
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.204-rt100.tar.xz
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.215-rt107.tar.xz
Create a kthread for each console to perform console printing. Now
all console printing is fully asynchronous except for the boot
@@ -17,11 +17,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Luis Claudio R. Goncalves <lgoncalv@redhat.com>
---
include/linux/console.h | 2 +
- kernel/printk/printk.c | 625 ++++++++++++----------------------------
- 2 files changed, 186 insertions(+), 441 deletions(-)
+ kernel/printk/printk.c | 631 ++++++++++++----------------------------
+ 2 files changed, 186 insertions(+), 447 deletions(-)
diff --git a/include/linux/console.h b/include/linux/console.h
-index fcc98354f733..3e99359e0660 100644
+index fcc98354f7332..3e99359e06602 100644
--- a/include/linux/console.h
+++ b/include/linux/console.h
@@ -155,6 +155,8 @@ struct console {
@@ -34,7 +34,7 @@ index fcc98354f733..3e99359e0660 100644
uint ospeed;
void *data;
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
-index 8a0af76b6f69..232ce58e94c2 100644
+index 1ce593876dca9..2dc54d08cd8bc 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -44,6 +44,7 @@
@@ -101,7 +101,7 @@ index 8a0af76b6f69..232ce58e94c2 100644
else
return false;
-@@ -1821,202 +1814,16 @@ static void print_sync_until(struct console *con, u64 seq)
+@@ -1821,208 +1814,16 @@ static void print_sync_until(struct console *con, u64 seq)
console_atomic_lock(&flags);
for (;;) {
@@ -254,6 +254,12 @@ index 8a0af76b6f69..232ce58e94c2 100644
- */
- mutex_acquire(&console_lock_dep_map, 0, 1, _THIS_IP_);
-
+- /*
+- * Update @console_may_schedule for trylock because the previous
+- * owner may have been schedulable.
+- */
+- console_may_schedule = 0;
+-
- return 1;
-}
-
@@ -306,7 +312,7 @@ index 8a0af76b6f69..232ce58e94c2 100644
#ifdef CONFIG_PRINTK_NMI
#define NUM_RECURSION_CTX 2
#else
-@@ -2287,39 +2094,16 @@ asmlinkage int vprintk_emit(int facility, int level,
+@@ -2293,39 +2094,16 @@ asmlinkage int vprintk_emit(int facility, int level,
const char *fmt, va_list args)
{
int printed_len;
@@ -347,7 +353,7 @@ index 8a0af76b6f69..232ce58e94c2 100644
wake_up_klogd();
return printed_len;
}
-@@ -2371,38 +2155,158 @@ asmlinkage __visible int printk(const char *fmt, ...)
+@@ -2377,38 +2155,158 @@ asmlinkage __visible int printk(const char *fmt, ...)
}
EXPORT_SYMBOL(printk);
@@ -434,9 +440,7 @@ index 8a0af76b6f69..232ce58e94c2 100644
+ }
+
+ printk_seq = atomic64_read(&con->printk_seq);
-
--static size_t record_print_text(const struct printk_record *r,
-- bool syslog, bool time)
++
+ console_lock();
+ console_may_schedule = 0;
+
@@ -450,7 +454,9 @@ index 8a0af76b6f69..232ce58e94c2 100644
+ "** %lu printk messages dropped **\n",
+ dropped);
+ dropped = 0;
-+
+
+-static size_t record_print_text(const struct printk_record *r,
+- bool syslog, bool time)
+ con->write(con, dropped_text, dropped_len);
+ printk_delay(r.info->level);
+ }
@@ -529,7 +535,7 @@ index 8a0af76b6f69..232ce58e94c2 100644
#endif /* CONFIG_PRINTK */
-@@ -2647,36 +2551,6 @@ int is_console_locked(void)
+@@ -2653,36 +2551,6 @@ int is_console_locked(void)
}
EXPORT_SYMBOL(is_console_locked);
@@ -566,7 +572,7 @@ index 8a0af76b6f69..232ce58e94c2 100644
/**
* console_unlock - unlock the console system
*
-@@ -2693,131 +2567,14 @@ static inline int can_use_console(void)
+@@ -2699,131 +2567,14 @@ static inline int can_use_console(void)
*/
void console_unlock(void)
{
@@ -698,7 +704,7 @@ index 8a0af76b6f69..232ce58e94c2 100644
}
EXPORT_SYMBOL(console_unlock);
-@@ -2867,18 +2624,20 @@ void console_unblank(void)
+@@ -2873,18 +2624,20 @@ void console_unblank(void)
*/
void console_flush_on_panic(enum con_flush_mode mode)
{
@@ -729,7 +735,7 @@ index 8a0af76b6f69..232ce58e94c2 100644
console_unlock();
}
-@@ -3013,7 +2772,6 @@ static int try_enable_new_console(struct console *newcon, bool user_specified)
+@@ -3052,7 +2805,6 @@ static void try_enable_default_console(struct console *newcon)
*/
void register_console(struct console *newcon)
{
@@ -737,7 +743,7 @@ index 8a0af76b6f69..232ce58e94c2 100644
struct console *bcon = NULL;
int err;
-@@ -3037,6 +2795,8 @@ void register_console(struct console *newcon)
+@@ -3076,6 +2828,8 @@ void register_console(struct console *newcon)
}
}
@@ -746,7 +752,7 @@ index 8a0af76b6f69..232ce58e94c2 100644
if (console_drivers && console_drivers->flags & CON_BOOT)
bcon = console_drivers;
-@@ -3101,27 +2861,12 @@ void register_console(struct console *newcon)
+@@ -3130,27 +2884,12 @@ void register_console(struct console *newcon)
if (newcon->flags & CON_EXTENDED)
nr_ext_console_drivers++;
@@ -779,7 +785,7 @@ index 8a0af76b6f69..232ce58e94c2 100644
console_unlock();
console_sysfs_notify();
-@@ -3195,6 +2940,9 @@ int unregister_console(struct console *console)
+@@ -3224,6 +2963,9 @@ int unregister_console(struct console *console)
console_unlock();
console_sysfs_notify();
@@ -789,7 +795,7 @@ index 8a0af76b6f69..232ce58e94c2 100644
if (console->exit)
res = console->exit(console);
-@@ -3277,6 +3025,15 @@ static int __init printk_late_init(void)
+@@ -3306,6 +3048,15 @@ static int __init printk_late_init(void)
unregister_console(con);
}
}
@@ -805,7 +811,7 @@ index 8a0af76b6f69..232ce58e94c2 100644
ret = cpuhp_setup_state_nocalls(CPUHP_PRINTK_DEAD, "printk:dead", NULL,
console_cpu_notify);
WARN_ON(ret < 0);
-@@ -3292,7 +3049,6 @@ late_initcall(printk_late_init);
+@@ -3321,7 +3072,6 @@ late_initcall(printk_late_init);
* Delayed printk version, for scheduler-internal messages:
*/
#define PRINTK_PENDING_WAKEUP 0x01
@@ -813,7 +819,7 @@ index 8a0af76b6f69..232ce58e94c2 100644
static DEFINE_PER_CPU(int, printk_pending);
-@@ -3300,14 +3056,8 @@ static void wake_up_klogd_work_func(struct irq_work *irq_work)
+@@ -3329,14 +3079,8 @@ static void wake_up_klogd_work_func(struct irq_work *irq_work)
{
int pending = __this_cpu_xchg(printk_pending, 0);
@@ -829,7 +835,7 @@ index 8a0af76b6f69..232ce58e94c2 100644
}
static DEFINE_PER_CPU(struct irq_work, wake_up_klogd_work) = {
-@@ -3330,13 +3080,6 @@ void wake_up_klogd(void)
+@@ -3359,13 +3103,6 @@ void wake_up_klogd(void)
void defer_console_output(void)
{
@@ -844,5 +850,5 @@ index 8a0af76b6f69..232ce58e94c2 100644
int vprintk_deferred(const char *fmt, va_list args)
--
-2.43.0
+2.44.0