Loading init/Kconfig +10 −0 Original line number Diff line number Diff line Loading @@ -531,6 +531,16 @@ config LOG_BUF_SHIFT 13 => 8 KB 12 => 4 KB config CONSOLE_FLUSH_ON_HOTPLUG bool "Enable console flush configurable in hot plug code path" depends on HOTPLUG_CPU def_bool n help In cpu hot plug path console lock acquire and release causes the console to flush. If console lock is not free hot plug latency increases. So make console flush configurable in hot plug path and default disabled to help in cpu hot plug latencies. config LOG_CPU_MAX_BUF_SHIFT int "CPU kernel log buffer size contribution (13 => 8 KB, 17 => 128KB)" depends on SMP Loading kernel/printk/printk.c +8 −2 Original line number Diff line number Diff line Loading @@ -2021,6 +2021,8 @@ void resume_console(void) console_unlock(); } #ifdef CONFIG_CONSOLE_FLUSH_ON_HOTPLUG /** * console_cpu_notify - print deferred console messages after CPU hotplug * @cpu: unused Loading @@ -2040,6 +2042,8 @@ static int console_cpu_notify(unsigned int cpu) return 0; } #endif /** * console_lock - lock the console system for exclusive use. * Loading Loading @@ -2652,7 +2656,7 @@ void __init console_init(void) static int __init printk_late_init(void) { struct console *con; int ret; int ret = 0; for_each_console(con) { if (!(con->flags & CON_BOOT)) Loading @@ -2674,13 +2678,15 @@ static int __init printk_late_init(void) unregister_console(con); } } #ifdef CONFIG_CONSOLE_FLUSH_ON_HOTPLUG ret = cpuhp_setup_state_nocalls(CPUHP_PRINTK_DEAD, "printk:dead", NULL, console_cpu_notify); WARN_ON(ret < 0); ret = cpuhp_setup_state_nocalls(CPUHP_AP_ONLINE_DYN, "printk:online", console_cpu_notify, NULL); WARN_ON(ret < 0); return 0; #endif return ret; } late_initcall(printk_late_init); Loading Loading
init/Kconfig +10 −0 Original line number Diff line number Diff line Loading @@ -531,6 +531,16 @@ config LOG_BUF_SHIFT 13 => 8 KB 12 => 4 KB config CONSOLE_FLUSH_ON_HOTPLUG bool "Enable console flush configurable in hot plug code path" depends on HOTPLUG_CPU def_bool n help In cpu hot plug path console lock acquire and release causes the console to flush. If console lock is not free hot plug latency increases. So make console flush configurable in hot plug path and default disabled to help in cpu hot plug latencies. config LOG_CPU_MAX_BUF_SHIFT int "CPU kernel log buffer size contribution (13 => 8 KB, 17 => 128KB)" depends on SMP Loading
kernel/printk/printk.c +8 −2 Original line number Diff line number Diff line Loading @@ -2021,6 +2021,8 @@ void resume_console(void) console_unlock(); } #ifdef CONFIG_CONSOLE_FLUSH_ON_HOTPLUG /** * console_cpu_notify - print deferred console messages after CPU hotplug * @cpu: unused Loading @@ -2040,6 +2042,8 @@ static int console_cpu_notify(unsigned int cpu) return 0; } #endif /** * console_lock - lock the console system for exclusive use. * Loading Loading @@ -2652,7 +2656,7 @@ void __init console_init(void) static int __init printk_late_init(void) { struct console *con; int ret; int ret = 0; for_each_console(con) { if (!(con->flags & CON_BOOT)) Loading @@ -2674,13 +2678,15 @@ static int __init printk_late_init(void) unregister_console(con); } } #ifdef CONFIG_CONSOLE_FLUSH_ON_HOTPLUG ret = cpuhp_setup_state_nocalls(CPUHP_PRINTK_DEAD, "printk:dead", NULL, console_cpu_notify); WARN_ON(ret < 0); ret = cpuhp_setup_state_nocalls(CPUHP_AP_ONLINE_DYN, "printk:online", console_cpu_notify, NULL); WARN_ON(ret < 0); return 0; #endif return ret; } late_initcall(printk_late_init); Loading