aboutsummaryrefslogtreecommitdiffstats
path: root/init
diff options
context:
space:
mode:
authorLinus Torvalds2017-02-22 19:33:34 -0600
committerLinus Torvalds2017-02-22 19:33:34 -0600
commit7d91de74436a69c2b78a7a72f1e7f97f8b4396fa (patch)
treea43e68ae4ebbf0ec98678876d584fb0eb0303274 /init
parent6ef192f2259e78e1870c509fbd3040e6752b3b9c (diff)
parentd9c23523ed98a3acaa0bfd8fef143595d6aa631d (diff)
downloadkernel-7d91de74436a69c2b78a7a72f1e7f97f8b4396fa.tar.gz
kernel-7d91de74436a69c2b78a7a72f1e7f97f8b4396fa.tar.xz
kernel-7d91de74436a69c2b78a7a72f1e7f97f8b4396fa.zip
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/pmladek/printk
Pull printk updates from Petr Mladek: - Add Petr Mladek, Sergey Senozhatsky as printk maintainers, and Steven Rostedt as the printk reviewer. This idea came up after the discussion about printk issues at Kernel Summit. It was formulated and discussed at lkml[1]. - Extend a lock-less NMI per-cpu buffers idea to handle recursive printk() calls by Sergey Senozhatsky[2]. It is the first step in sanitizing printk as discussed at Kernel Summit. The change allows to see messages that would normally get ignored or would cause a deadlock. Also it allows to enable lockdep in printk(). This already paid off. The testing in linux-next helped to discover two old problems that were hidden before[3][4]. - Remove unused parameter by Sergey Senozhatsky. Clean up after a past change. [1] http://lkml.kernel.org/r/1481798878-31898-1-git-send-email-pmladek@suse.com [2] http://lkml.kernel.org/r/20161227141611.940-1-sergey.senozhatsky@gmail.com [3] http://lkml.kernel.org/r/20170215044332.30449-1-sergey.senozhatsky@gmail.com [4] http://lkml.kernel.org/r/20170217015932.11898-1-sergey.senozhatsky@gmail.com * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/pmladek/printk: printk: drop call_console_drivers() unused param printk: convert the rest to printk-safe printk: remove zap_locks() function printk: use printk_safe buffers in printk printk: report lost messages in printk safe/nmi contexts printk: always use deferred printk when flush printk_safe lines printk: introduce per-cpu safe_print seq buffer printk: rename nmi.c and exported api printk: use vprintk_func in vprintk() MAINTAINERS: Add printk maintainers
Diffstat (limited to 'init')
-rw-r--r--init/Kconfig16
-rw-r--r--init/main.c2
2 files changed, 10 insertions, 8 deletions
diff --git a/init/Kconfig b/init/Kconfig
index 55bb6fbc294e..483ad679aa37 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -861,17 +861,19 @@ config LOG_CPU_MAX_BUF_SHIFT
861 13 => 8 KB for each CPU 861 13 => 8 KB for each CPU
862 12 => 4 KB for each CPU 862 12 => 4 KB for each CPU
863 863
864config NMI_LOG_BUF_SHIFT 864config PRINTK_SAFE_LOG_BUF_SHIFT
865 int "Temporary per-CPU NMI log buffer size (12 => 4KB, 13 => 8KB)" 865 int "Temporary per-CPU printk log buffer size (12 => 4KB, 13 => 8KB)"
866 range 10 21 866 range 10 21
867 default 13 867 default 13
868 depends on PRINTK_NMI 868 depends on PRINTK
869 help 869 help
870 Select the size of a per-CPU buffer where NMI messages are temporary 870 Select the size of an alternate printk per-CPU buffer where messages
871 stored. They are copied to the main log buffer in a safe context 871 printed from usafe contexts are temporary stored. One example would
872 to avoid a deadlock. The value defines the size as a power of 2. 872 be NMI messages, another one - printk recursion. The messages are
873 copied to the main log buffer in a safe context to avoid a deadlock.
874 The value defines the size as a power of 2.
873 875
874 NMI messages are rare and limited. The largest one is when 876 Those messages are rare and limited. The largest one is when
875 a backtrace is printed. It usually fits into 4KB. Select 877 a backtrace is printed. It usually fits into 4KB. Select
876 8KB if you want to be on the safe side. 878 8KB if you want to be on the safe side.
877 879
diff --git a/init/main.c b/init/main.c
index c8a00f0f10ff..24ea48745061 100644
--- a/init/main.c
+++ b/init/main.c
@@ -581,7 +581,7 @@ asmlinkage __visible void __init start_kernel(void)
581 timekeeping_init(); 581 timekeeping_init();
582 time_init(); 582 time_init();
583 sched_clock_postinit(); 583 sched_clock_postinit();
584 printk_nmi_init(); 584 printk_safe_init();
585 perf_event_init(); 585 perf_event_init();
586 profile_init(); 586 profile_init();
587 call_function_init(); 587 call_function_init();