Skip to content

Commit 1529bbb

Browse files
jognesspmladek
authored andcommitted
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 <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>
1 parent 5f53ca3 commit 1529bbb

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

kernel/printk/nbcon.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1321,6 +1321,12 @@ bool nbcon_kthread_create(struct console *con)
13211321

13221322
con->kthread = kt;
13231323

1324+
/*
1325+
* It is important that console printing threads are scheduled
1326+
* shortly after a printk call and with generous runtime budgets.
1327+
*/
1328+
sched_set_normal(con->kthread, -20);
1329+
13241330
return true;
13251331
}
13261332

kernel/printk/printk.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3555,6 +3555,12 @@ static bool legacy_kthread_create(void)
35553555

35563556
printk_legacy_kthread = kt;
35573557

3558+
/*
3559+
* It is important that console printing threads are scheduled
3560+
* shortly after a printk call and with generous runtime budgets.
3561+
*/
3562+
sched_set_normal(printk_legacy_kthread, -20);
3563+
35583564
return true;
35593565
}
35603566

0 commit comments

Comments
 (0)