From: John Ogness Date: Wed, 4 Sep 2024 12:05:35 +0000 (+0206) Subject: printk: nbcon: Assign nice -20 for printing threads X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=1529bbb6e2619495f146dd519a196b67837fdfa6;p=users%2Fjedix%2Flinux-maple.git printk: nbcon: Assign nice -20 for printing threads It is important that console printing threads are scheduled shortly after a printk call and with generous runtime budgets. Signed-off-by: John Ogness Reviewed-by: Petr Mladek Link: https://lore.kernel.org/r/20240904120536.115780-17-john.ogness@linutronix.de Signed-off-by: Petr Mladek --- diff --git a/kernel/printk/nbcon.c b/kernel/printk/nbcon.c index 98440889d222d..fd12efcc4aeda 100644 --- a/kernel/printk/nbcon.c +++ b/kernel/printk/nbcon.c @@ -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; } diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c index 66cfe7b8f95cb..afd926611f0f3 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c @@ -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; }