OSDN Git Service

printk: Make the console flush configurable in hotplug path
authorMohammed Khajapasha <mkhaja@codeaurora.org>
Fri, 4 Sep 2015 15:03:31 +0000 (20:33 +0530)
committerGerrit - the friendly Code Review server <code-review@localhost>
Thu, 6 Sep 2018 11:04:46 +0000 (04:04 -0700)
The thread which initiates the hot plug can get scheduled
out, while trying to acquire the console lock,
thus increasing the hot plug latency. This option
allows to selectively disable the console flush and
in turn reduce the hot plug latency.

Change-Id: I42507804d321b29b7761146a6c175d959bf79925
Signed-off-by: Mohammed Khajapasha <mkhaja@codeaurora.org>
Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
Signed-off-by: Neeraj Upadhyay <neeraju@codeaurora.org>
init/Kconfig
kernel/printk/printk.c

index ec2342b..a73b645 100644 (file)
@@ -850,6 +850,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
index dca8779..da573ae 100644 (file)
@@ -2119,6 +2119,8 @@ void resume_console(void)
        console_unlock();
 }
 
+#ifdef CONFIG_CONSOLE_FLUSH_ON_HOTPLUG
+
 /**
  * console_cpu_notify - print deferred console messages after CPU hotplug
  * @self: notifier struct
@@ -2148,6 +2150,8 @@ static int console_cpu_notify(struct notifier_block *self,
        return NOTIFY_OK;
 }
 
+#endif
+
 /**
  * console_lock - lock the console system for exclusive use.
  *
@@ -2712,7 +2716,9 @@ static int __init printk_late_init(void)
                        unregister_console(con);
                }
        }
+#ifdef CONFIG_CONSOLE_FLUSH_ON_HOTPLUG
        hotcpu_notifier(console_cpu_notify, 0);
+#endif
        return 0;
 }
 late_initcall(printk_late_init);