[PATCH printk v3 18/19] printk: nbcon: Assign nice -20 for printing threads

John Ogness posted 19 patches 1 year, 4 months ago
There is a newer version of this series
[PATCH printk v3 18/19] printk: nbcon: Assign nice -20 for printing threads
Posted by John Ogness 1 year, 4 months ago
It is important that console printing threads are scheduled
shortly after a printk call and with generous runtime budgets.

Signed-off-by: John Ogness <john.ogness@linutronix.de>
---
 kernel/printk/nbcon.c  | 6 ++++++
 kernel/printk/printk.c | 6 ++++++
 2 files changed, 12 insertions(+)

diff --git a/kernel/printk/nbcon.c b/kernel/printk/nbcon.c
index 2a61f2c68ddc..e34e5c5a7843 100644
--- a/kernel/printk/nbcon.c
+++ b/kernel/printk/nbcon.c
@@ -1260,6 +1260,12 @@ bool nbcon_kthread_create(struct console *con)
 
 	con->kthread = kt;
 
+	/*
+	 * It is important that console printing threads are scheduled
+	 * shortly after a printk call and with generous runtime budgets.
+	 */
+	sched_set_normal(con->kthread, -20);
+
 	return true;
 }
 
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index 6f70d3a7153f..36087a6d579f 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -3504,6 +3504,12 @@ static bool legacy_kthread_create(void)
 
 	printk_legacy_kthread = kt;
 
+	/*
+	 * It is important that console printing threads are scheduled
+	 * shortly after a printk call and with generous runtime budgets.
+	 */
+	sched_set_normal(printk_legacy_kthread, -20);
+
 	return true;
 }
 
-- 
2.39.2
Re: [PATCH printk v3 18/19] printk: nbcon: Assign nice -20 for printing threads
Posted by Petr Mladek 1 year, 4 months ago
On Mon 2024-07-22 19:25:38, John Ogness wrote:
> It is important that console printing threads are scheduled
> shortly after a printk call and with generous runtime budgets.
> 
> Signed-off-by: John Ogness <john.ogness@linutronix.de>

Reviewed-by: Petr Mladek <pmladek@suse.com>

Best Regards,
Petr