]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
printk: nbcon: Assign nice -20 for printing threads
authorJohn Ogness <john.ogness@linutronix.de>
Wed, 4 Sep 2024 12:05:35 +0000 (14:11 +0206)
committerPetr Mladek <pmladek@suse.com>
Wed, 4 Sep 2024 13:56:33 +0000 (15:56 +0200)
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>
Link: https://lore.kernel.org/r/20240904120536.115780-17-john.ogness@linutronix.de
Signed-off-by: Petr Mladek <pmladek@suse.com>
kernel/printk/nbcon.c
kernel/printk/printk.c

index 98440889d222d94289c52fe8b06e16dfdad135c3..fd12efcc4aeda8883773d9807bc215f6e5cdf71a 100644 (file)
@@ -1321,6 +1321,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;
 }
 
index 66cfe7b8f95cbf5046ff428bedc076394b93d82a..afd926611f0f314075049cf791c2bcc6baa7df69 100644 (file)
@@ -3555,6 +3555,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;
 }