Skip to contentSkip to conversation

Config printk buffer size

PATCH Thomas Dodd 2 participants 3 messages Apr 5, 2001

Subsystems (9)
Documentation Arm (32-bit) MIPS s390 +5 more subsystems
lore
Share & tools
lore
#0 lore raw

This should allow the printk buffer to be sized during config. The default size is still 16K. It could use some checking to insure power-of-2, but CML1 doesn't have a way to
do it that I see. All the architectures should be covered, and all the default files also have it.

It gets added in the kernel hacking section.

Having 8 software raid volumes most of the kernel hardware detection messages get lost. Having to edit kernel/printk.c before/after every kernel change is a mess and easy to forget.

I'm gouing to work on a resizing buffer, that drops to 4K or 8K after dmesg is called with the right switch.

Patch against 2.4.3-ac2 since it has more arch supported.

The embedded systems like arm, might want to change the default size to something smaller for their arch, whiuch is easier with this patch.

-Thomas

Documentation/Configure.help +7 -1
diff -u --new-file --recursive linux-2.4.3-ac2.orig/Documentation/Configure.help linux-2.4.3-ac2/Documentation/Configure.help
@@ -15191,7 +15191,13 @@
   send a BREAK and then within 5 seconds a command keypress. The
   keys are documented in Documentation/sysrq.txt. Don't say Y unless
   you really know what this hack does.
-
+Printk buffer size
+CONFIG_PRINTK_BUF_LEN
+  Printk buffer size in K bytes. This should be a power of 2.
+  The 2.2.x kernels used a default of 8. The 2.4.x kernels
+  use a default of 16. Systems with many Software-RAID volumes
+  should increase since the md.o drivers have a lot of printk
+  output during boot.
 ISDN subsystem
 CONFIG_ISDN
   ISDN ("Integrated Services Digital Networks", called RNIS in France)
arch/alpha/config.in +1 -0
diff -u --new-file --recursive linux-2.4.3-ac2.orig/arch/alpha/config.in linux-2.4.3-ac2/arch/alpha/config.in
@@ -361,6 +361,7 @@
 fi
 
 bool 'Magic SysRq key' CONFIG_MAGIC_SYSRQ
+int 'Printk buffer size (in K bytes)' CONFIG_PRINTK_BUF_LEN 16
 
 bool 'Legacy kernel start address' CONFIG_ALPHA_LEGACY_START_ADDRESS
 
arch/alpha/defconfig +1 -0
diff -u --new-file --recursive linux-2.4.3-ac2.orig/arch/alpha/defconfig linux-2.4.3-ac2/arch/alpha/defconfig
@@ -634,4 +634,5 @@
 #
 CONFIG_MATHEMU=y
 CONFIG_MAGIC_SYSRQ=y
+CONFIG_PRINTK_BUF_LEN=16
 CONFIG_ALPHA_LEGACY_START_ADDRESS=y
arch/arm/config.in +1 -0
diff -u --new-file --recursive linux-2.4.3-ac2.orig/arch/arm/config.in linux-2.4.3-ac2/arch/arm/config.in
@@ -414,6 +414,7 @@
 bool 'Verbose user fault messages' CONFIG_DEBUG_USER
 bool 'Include debugging information in kernel binary' CONFIG_DEBUG_INFO
 bool 'Magic SysRq key' CONFIG_MAGIC_SYSRQ
+int 'Printk buffer size (in K bytes)' CONFIG_PRINTK_BUF_LEN 16
 if [ "$CONFIG_CPU_26" = "y" ]; then
    bool 'Disable pgtable cache' CONFIG_NO_PGT_CACHE
 fi
arch/arm/def-configs/a5k +1 -0
diff -u --new-file --recursive linux-2.4.3-ac2.orig/arch/arm/def-configs/a5k linux-2.4.3-ac2/arch/arm/def-configs/a5k
@@ -532,5 +532,6 @@
 CONFIG_DEBUG_USER=y
 # CONFIG_DEBUG_INFO is not set
 CONFIG_MAGIC_SYSRQ=y
+CONFIG_PRINTK_BUF_LEN=16
 CONFIG_NO_PGT_CACHE=y
 CONFIG_DEBUG_LL=y
arch/arm/def-configs/assabet +1 -0
diff -u --new-file --recursive linux-2.4.3-ac2.orig/arch/arm/def-configs/assabet linux-2.4.3-ac2/arch/arm/def-configs/assabet
@@ -566,4 +566,5 @@
 CONFIG_DEBUG_USER=y
 # CONFIG_DEBUG_INFO is not set
 # CONFIG_MAGIC_SYSRQ is not set
+CONFIG_PRINTK_BUF_LEN=16
 # CONFIG_DEBUG_LL is not set
arch/arm/def-configs/brutus +1 -0
diff -u --new-file --recursive linux-2.4.3-ac2.orig/arch/arm/def-configs/brutus linux-2.4.3-ac2/arch/arm/def-configs/brutus
@@ -293,4 +293,5 @@
 CONFIG_DEBUG_USER=y
 CONFIG_DEBUG_INFO=y
 # CONFIG_MAGIC_SYSRQ is not set
+CONFIG_PRINTK_BUF_LEN=16
 # CONFIG_DEBUG_LL is not set
arch/arm/def-configs/cerf +1 -0
diff -u --new-file --recursive linux-2.4.3-ac2.orig/arch/arm/def-configs/cerf linux-2.4.3-ac2/arch/arm/def-configs/cerf
@@ -431,4 +431,5 @@
 CONFIG_DEBUG_USER=y
 # CONFIG_DEBUG_INFO is not set
 # CONFIG_MAGIC_SYSRQ is not set
+CONFIG_PRINTK_BUF_LEN=16
 # CONFIG_DEBUG_LL is not set
arch/arm/def-configs/clps7500 +1 -0
diff -u --new-file --recursive linux-2.4.3-ac2.orig/arch/arm/def-configs/clps7500 linux-2.4.3-ac2/arch/arm/def-configs/clps7500
@@ -487,4 +487,5 @@
 # CONFIG_DEBUG_USER is not set
 # CONFIG_DEBUG_INFO is not set
 CONFIG_MAGIC_SYSRQ=y
+CONFIG_PRINTK_BUF_LEN=16
 # CONFIG_DEBUG_LL is not set
arch/arm/def-configs/ebsa110 +1 -0
diff -u --new-file --recursive linux-2.4.3-ac2.orig/arch/arm/def-configs/ebsa110 linux-2.4.3-ac2/arch/arm/def-configs/ebsa110
@@ -502,4 +502,5 @@
 # CONFIG_DEBUG_USER is not set
 # CONFIG_DEBUG_INFO is not set
 # CONFIG_MAGIC_SYSRQ is not set
+CONFIG_PRINTK_BUF_LEN=16
 # CONFIG_DEBUG_LL is not set
arch/arm/def-configs/empeg +1 -0
diff -u --new-file --recursive linux-2.4.3-ac2.orig/arch/arm/def-configs/empeg linux-2.4.3-ac2/arch/arm/def-configs/empeg
@@ -261,4 +261,5 @@
 CONFIG_DEBUG_USER_BACKTRACE=y
 # CONFIG_DEBUG_INFO is not set
 # CONFIG_MAGIC_SYSRQ is not set
+CONFIG_PRINTK_BUF_LEN=16
 # CONFIG_DEBUG_LL is not set
arch/arm/def-configs/footbridge +1 -0
diff -u --new-file --recursive linux-2.4.3-ac2.orig/arch/arm/def-configs/footbridge linux-2.4.3-ac2/arch/arm/def-configs/footbridge
@@ -890,5 +890,6 @@
 CONFIG_DEBUG_USER=y
 # CONFIG_DEBUG_INFO is not set
 CONFIG_MAGIC_SYSRQ=y
+CONFIG_PRINTK_BUF_LEN=16
 CONFIG_DEBUG_LL=y
 # CONFIG_DEBUG_DC21285_PORT is not set
arch/arm/def-configs/graphicsclient +1 -0
diff -u --new-file --recursive linux-2.4.3-ac2.orig/arch/arm/def-configs/graphicsclient linux-2.4.3-ac2/arch/arm/def-configs/graphicsclient
@@ -541,4 +541,5 @@
 CONFIG_DEBUG_USER=y
 # CONFIG_DEBUG_INFO is not set
 # CONFIG_MAGIC_SYSRQ is not set
+CONFIG_PRINTK_BUF_LEN=16
 # CONFIG_DEBUG_LL is not set
arch/arm/def-configs/integrator +1 -0
diff -u --new-file --recursive linux-2.4.3-ac2.orig/arch/arm/def-configs/integrator linux-2.4.3-ac2/arch/arm/def-configs/integrator
@@ -508,4 +508,5 @@
 CONFIG_DEBUG_USER=y
 # CONFIG_DEBUG_INFO is not set
 CONFIG_MAGIC_SYSRQ=y
+CONFIG_PRINTK_BUF_LEN=16
 CONFIG_DEBUG_LL=y
arch/arm/def-configs/lart +1 -0
diff -u --new-file --recursive linux-2.4.3-ac2.orig/arch/arm/def-configs/lart linux-2.4.3-ac2/arch/arm/def-configs/lart
@@ -492,4 +492,5 @@
 CONFIG_DEBUG_USER=y
 # CONFIG_DEBUG_INFO is not set
 CONFIG_MAGIC_SYSRQ=y
+CONFIG_PRINTK_BUF_LEN=16
 CONFIG_DEBUG_LL=y
arch/arm/def-configs/lusl7200 +1 -0
diff -u --new-file --recursive linux-2.4.3-ac2.orig/arch/arm/def-configs/lusl7200 linux-2.4.3-ac2/arch/arm/def-configs/lusl7200
@@ -226,4 +226,5 @@
 CONFIG_DEBUG_USER=y
 CONFIG_DEBUG_INFO=y
 # CONFIG_MAGIC_SYSRQ is not set
+CONFIG_PRINTK_BUF_LEN=16
 CONFIG_DEBUG_LL=y
arch/arm/def-configs/neponset +1 -0
diff -u --new-file --recursive linux-2.4.3-ac2.orig/arch/arm/def-configs/neponset linux-2.4.3-ac2/arch/arm/def-configs/neponset
@@ -573,4 +573,5 @@
 CONFIG_DEBUG_USER=y
 # CONFIG_DEBUG_INFO is not set
 # CONFIG_MAGIC_SYSRQ is not set
+CONFIG_PRINTK_BUF_LEN=16
 # CONFIG_DEBUG_LL is not set
arch/arm/def-configs/pangolin +1 -0
diff -u --new-file --recursive linux-2.4.3-ac2.orig/arch/arm/def-configs/pangolin linux-2.4.3-ac2/arch/arm/def-configs/pangolin
@@ -488,4 +488,5 @@
 CONFIG_DEBUG_USER=y
 # CONFIG_DEBUG_INFO is not set
 # CONFIG_MAGIC_SYSRQ is not set
+CONFIG_PRINTK_BUF_LEN=16
 # CONFIG_DEBUG_LL is not set
arch/arm/def-configs/rpc +1 -0
diff -u --new-file --recursive linux-2.4.3-ac2.orig/arch/arm/def-configs/rpc linux-2.4.3-ac2/arch/arm/def-configs/rpc
@@ -707,4 +707,5 @@
 CONFIG_DEBUG_USER=y
 # CONFIG_DEBUG_INFO is not set
 CONFIG_MAGIC_SYSRQ=y
+CONFIG_PRINTK_BUF_LEN=16
 CONFIG_DEBUG_LL=y
arch/arm/def-configs/shark +1 -0
diff -u --new-file --recursive linux-2.4.3-ac2.orig/arch/arm/def-configs/shark linux-2.4.3-ac2/arch/arm/def-configs/shark
@@ -652,4 +652,5 @@
 CONFIG_DEBUG_USER=y
 # CONFIG_DEBUG_INFO is not set
 # CONFIG_MAGIC_SYSRQ is not set
+CONFIG_PRINTK_BUF_LEN=16
 CONFIG_DEBUG_LL=y
arch/arm/def-configs/sherman +1 -0
diff -u --new-file --recursive linux-2.4.3-ac2.orig/arch/arm/def-configs/sherman linux-2.4.3-ac2/arch/arm/def-configs/sherman
@@ -207,4 +207,5 @@
 CONFIG_DEBUG_USER=y
 CONFIG_DEBUG_INFO=y
 # CONFIG_MAGIC_SYSRQ is not set
+CONFIG_PRINTK_BUF_LEN=16
 CONFIG_DEBUG_LL=y
arch/arm/def-configs/victor +1 -0
diff -u --new-file --recursive linux-2.4.3-ac2.orig/arch/arm/def-configs/victor linux-2.4.3-ac2/arch/arm/def-configs/victor
@@ -200,4 +200,5 @@
 CONFIG_DEBUG_USER=y
 # CONFIG_DEBUG_INFO is not set
 # CONFIG_MAGIC_SYSRQ is not set
+CONFIG_PRINTK_BUF_LEN=16
 # CONFIG_DEBUG_LL is not set
arch/arm/defconfig +1 -0
diff -u --new-file --recursive linux-2.4.3-ac2.orig/arch/arm/defconfig linux-2.4.3-ac2/arch/arm/defconfig
@@ -719,4 +719,5 @@
 CONFIG_DEBUG_USER=y
 # CONFIG_DEBUG_INFO is not set
 CONFIG_MAGIC_SYSRQ=y
+CONFIG_PRINTK_BUF_LEN=16
 # CONFIG_DEBUG_LL is not set
arch/cris/config.in +1 -0
diff -u --new-file --recursive linux-2.4.3-ac2.orig/arch/cris/config.in linux-2.4.3-ac2/arch/cris/config.in
@@ -223,4 +223,5 @@
 if [ "$CONFIG_PROFILE" = "y" ]; then
   int ' Profile shift count' CONFIG_PROFILE_SHIFT 2
 fi
+int 'Printk buffer size (in K bytes)' CONFIG_PRINTK_BUF_LEN 16
 endmenu
arch/cris/defconfig +1 -0
diff -u --new-file --recursive linux-2.4.3-ac2.orig/arch/cris/defconfig linux-2.4.3-ac2/arch/cris/defconfig
@@ -472,3 +472,4 @@
 # Kernel hacking
 #
 # CONFIG_PROFILE is not set
+CONFIG_PRINTK_BUF_LEN=16
arch/i386/config.in +1 -0
diff -u --new-file --recursive linux-2.4.3-ac2.orig/arch/i386/config.in linux-2.4.3-ac2/arch/i386/config.in
@@ -384,6 +384,7 @@
 
 bool '  Debug memory allocations' CONFIG_DEBUG_SLAB
 bool '  Memory mapped I/O debugging' CONFIG_DEBUG_IOVIRT
+ int '  Printk buffer size (in K bytes)' CONFIG_PRINTK_BUF_LEN 16
 bool '  Magic SysRq key' CONFIG_MAGIC_SYSRQ
 bool '  Spinlock debugging' CONFIG_DEBUG_SPINLOCK
 bool '  Verbose BUG() reporting (adds 70K)' CONFIG_DEBUG_BUGVERBOSE
arch/i386/defconfig +1 -0
diff -u --new-file --recursive linux-2.4.3-ac2.orig/arch/i386/defconfig linux-2.4.3-ac2/arch/i386/defconfig
@@ -722,3 +722,4 @@
 #
 CONFIG_DEBUG_IOVIRT=y
 # CONFIG_MAGIC_SYSRQ is not set
+CONFIG_PRINTK_BUF_LEN=16
arch/ia64/config.in +1 -1
diff -u --new-file --recursive linux-2.4.3-ac2.orig/arch/ia64/config.in linux-2.4.3-ac2/arch/ia64/config.in
@@ -255,5 +255,5 @@
 bool 'Print possible IA64 hazards to console' CONFIG_IA64_PRINT_HAZARDS
 bool 'Enable new unwind support' CONFIG_IA64_NEW_UNWIND
 bool 'Disable VHPT' CONFIG_DISABLE_VHPT
-
+int 'Printk buffer size (in K bytes)' CONFIG_PRINTK_BUF_LEN 16
 endmenu
arch/ia64/defconfig +1 -0
diff -u --new-file --recursive linux-2.4.3-ac2.orig/arch/ia64/defconfig linux-2.4.3-ac2/arch/ia64/defconfig
@@ -276,3 +276,4 @@
 # CONFIG_IA64_DEBUG_IRQ is not set
 # CONFIG_IA64_PRINT_HAZARDS is not set
 # CONFIG_KDB is not set
+CONFIG_PRINTK_BUF_LEN=16
arch/m68k/config.in +1 -0
diff -u --new-file --recursive linux-2.4.3-ac2.orig/arch/m68k/config.in linux-2.4.3-ac2/arch/m68k/config.in
@@ -540,4 +540,5 @@
 
 #bool 'Debug kmalloc/kfree' CONFIG_DEBUG_MALLOC
 bool 'Magic SysRq key' CONFIG_MAGIC_SYSRQ
+int 'Printk buffer size (in K bytes)' CONFIG_PRINTK_BUF_LEN 16
 endmenu
arch/m68k/defconfig +1 -0
diff -u --new-file --recursive linux-2.4.3-ac2.orig/arch/m68k/defconfig linux-2.4.3-ac2/arch/m68k/defconfig
@@ -327,3 +327,4 @@
 # Kernel hacking
 #
 # CONFIG_MAGIC_SYSRQ is not set
+CONFIG_PRINTK_BUF_LEN=16
arch/mips/config.in +1 -0
diff -u --new-file --recursive linux-2.4.3-ac2.orig/arch/mips/config.in linux-2.4.3-ac2/arch/mips/config.in
@@ -400,4 +400,5 @@
   bool 'Remote GDB kernel debugging' CONFIG_REMOTE_DEBUG
 fi
 bool 'Magic SysRq key' CONFIG_MAGIC_SYSRQ
+int 'Printk buffer size (in K bytes)' CONFIG_PRINTK_BUF_LEN 16
 endmenu
arch/mips/defconfig +1 -1
diff -u --new-file --recursive linux-2.4.3-ac2.orig/arch/mips/defconfig linux-2.4.3-ac2/arch/mips/defconfig
@@ -354,4 +354,4 @@
 #
 CONFIG_CROSSCOMPILE=y
 # CONFIG_MIPS_FPE_MODULE is not set
-# CONFIG_MAGIC_SYSRQ is not set
+# CONFIG_MAGIC_SYSRQ is not setCONFIG_PRINTK_BUF_LEN=16
arch/mips/defconfig-cobalt +1 -0
diff -u --new-file --recursive linux-2.4.3-ac2.orig/arch/mips/defconfig-cobalt linux-2.4.3-ac2/arch/mips/defconfig-cobalt
@@ -596,3 +596,4 @@
 # CONFIG_CROSSCOMPILE is not set
 # CONFIG_MIPS_FPE_MODULE is not set
 # CONFIG_MAGIC_SYSRQ is not set
+CONFIG_PRINTK_BUF_LEN=16
arch/mips/defconfig-ddb5476 +1 -0
diff -u --new-file --recursive linux-2.4.3-ac2.orig/arch/mips/defconfig-ddb5476 linux-2.4.3-ac2/arch/mips/defconfig-ddb5476
@@ -539,3 +539,4 @@
 # CONFIG_LL_DEBUG is not set
 # CONFIG_MAGIC_SYSRQ is not set
 # CONFIG_MIPS_UNCACHED is not set
+CONFIG_PRINTK_BUF_LEN=16
arch/mips/defconfig-decstation +1 -0
diff -u --new-file --recursive linux-2.4.3-ac2.orig/arch/mips/defconfig-decstation linux-2.4.3-ac2/arch/mips/defconfig-decstation
@@ -328,3 +328,4 @@
 # CONFIG_MIPS_FPE_MODULE is not set
 # CONFIG_REMOTE_DEBUG is not set
 # CONFIG_MAGIC_SYSRQ is not set
+CONFIG_PRINTK_BUF_LEN=16
arch/mips/defconfig-ip22 +1 -0
diff -u --new-file --recursive linux-2.4.3-ac2.orig/arch/mips/defconfig-ip22 linux-2.4.3-ac2/arch/mips/defconfig-ip22
@@ -355,3 +355,4 @@
 CONFIG_CROSSCOMPILE=y
 # CONFIG_MIPS_FPE_MODULE is not set
 # CONFIG_MAGIC_SYSRQ is not set
+CONFIG_PRINTK_BUF_LEN=16
arch/mips/defconfig-it8172 +1 -0
diff -u --new-file --recursive linux-2.4.3-ac2.orig/arch/mips/defconfig-it8172 linux-2.4.3-ac2/arch/mips/defconfig-it8172
@@ -567,3 +567,4 @@
 # CONFIG_LL_DEBUG is not set
 # CONFIG_MAGIC_SYSRQ is not set
 # CONFIG_MIPS_UNCACHED is not set
+CONFIG_PRINTK_BUF_LEN=16
arch/mips/defconfig-orion +1 -0
diff -u --new-file --recursive linux-2.4.3-ac2.orig/arch/mips/defconfig-orion linux-2.4.3-ac2/arch/mips/defconfig-orion
@@ -302,3 +302,4 @@
 #
 CONFIG_CROSSCOMPILE=y
 # CONFIG_MAGIC_SYSRQ is not set
+CONFIG_PRINTK_BUF_LEN=16
arch/mips/defconfig-rm200 +1 -0
diff -u --new-file --recursive linux-2.4.3-ac2.orig/arch/mips/defconfig-rm200 linux-2.4.3-ac2/arch/mips/defconfig-rm200
@@ -363,3 +363,4 @@
 CONFIG_CROSSCOMPILE=y
 # CONFIG_MIPS_FPE_MODULE is not set
 # CONFIG_MAGIC_SYSRQ is not set
+CONFIG_PRINTK_BUF_LEN=16
arch/mips64/config.in +1 -0
diff -u --new-file --recursive linux-2.4.3-ac2.orig/arch/mips64/config.in linux-2.4.3-ac2/arch/mips64/config.in
@@ -265,4 +265,5 @@
 fi
 bool 'Remote GDB kernel debugging' CONFIG_REMOTE_DEBUG
 bool 'Magic SysRq key' CONFIG_MAGIC_SYSRQ
+int 'Printk buffer size (in K bytes)' CONFIG_PRINTK_BUF_LEN 16
 endmenu
arch/mips64/defconfig +1 -0
diff -u --new-file --recursive linux-2.4.3-ac2.orig/arch/mips64/defconfig linux-2.4.3-ac2/arch/mips64/defconfig
@@ -458,3 +458,4 @@
 CONFIG_CROSSCOMPILE=y
 # CONFIG_REMOTE_DEBUG is not set
 # CONFIG_MAGIC_SYSRQ is not set
+CONFIG_PRINTK_BUF_LEN=16
arch/mips64/defconfig-ip22 +1 -0
diff -u --new-file --recursive linux-2.4.3-ac2.orig/arch/mips64/defconfig-ip22 linux-2.4.3-ac2/arch/mips64/defconfig-ip22
@@ -372,3 +372,4 @@
 CONFIG_CROSSCOMPILE=y
 # CONFIG_REMOTE_DEBUG is not set
 # CONFIG_MAGIC_SYSRQ is not set
+CONFIG_PRINTK_BUF_LEN=16
arch/mips64/defconfig-ip27 +1 -0
diff -u --new-file --recursive linux-2.4.3-ac2.orig/arch/mips64/defconfig-ip27 linux-2.4.3-ac2/arch/mips64/defconfig-ip27
@@ -458,3 +458,4 @@
 CONFIG_CROSSCOMPILE=y
 # CONFIG_REMOTE_DEBUG is not set
 # CONFIG_MAGIC_SYSRQ is not set
+CONFIG_PRINTK_BUF_LEN=16
arch/parisc/config.common +1 -0
diff -u --new-file --recursive linux-2.4.3-ac2.orig/arch/parisc/config.common linux-2.4.3-ac2/arch/parisc/config.common
@@ -156,4 +156,5 @@
 
 #bool 'Debug kmalloc/kfree' CONFIG_DEBUG_MALLOC
 bool 'Magic SysRq key' CONFIG_MAGIC_SYSRQ
+int 'Printk buffer size (in K bytes)' CONFIG_PRINTK_BUF_LEN 16
 endmenu
arch/parisc/defconfig +1 -0
diff -u --new-file --recursive linux-2.4.3-ac2.orig/arch/parisc/defconfig linux-2.4.3-ac2/arch/parisc/defconfig
@@ -475,3 +475,4 @@
 # Kernel hacking
 #
 CONFIG_MAGIC_SYSRQ=y
+CONFIG_PRINTK_BUF_LEN=16
arch/ppc/config.in +1 -0
diff -u --new-file --recursive linux-2.4.3-ac2.orig/arch/ppc/config.in linux-2.4.3-ac2/arch/ppc/config.in
@@ -351,4 +351,5 @@
 bool 'Magic SysRq key' CONFIG_MAGIC_SYSRQ
 bool 'Include kgdb kernel debugger' CONFIG_KGDB
 bool 'Include xmon kernel debugger' CONFIG_XMON
+int 'Printk buffer size (in K bytes)' CONFIG_PRINTK_BUF_LEN 16
 endmenu
arch/ppc/configs/IVMS8_defconfig +1 -0
diff -u --new-file --recursive linux-2.4.3-ac2.orig/arch/ppc/configs/IVMS8_defconfig linux-2.4.3-ac2/arch/ppc/configs/IVMS8_defconfig
@@ -450,3 +450,4 @@
 # CONFIG_MAGIC_SYSRQ is not set
 # CONFIG_KGDB is not set
 # CONFIG_XMON is not set
+CONFIG_PRINTK_BUF_LEN=16
arch/ppc/configs/SM850_defconfig +1 -0
diff -u --new-file --recursive linux-2.4.3-ac2.orig/arch/ppc/configs/SM850_defconfig linux-2.4.3-ac2/arch/ppc/configs/SM850_defconfig
@@ -418,3 +418,4 @@
 # CONFIG_MAGIC_SYSRQ is not set
 # CONFIG_KGDB is not set
 # CONFIG_XMON is not set
+CONFIG_PRINTK_BUF_LEN=16
arch/ppc/configs/SPD823TS_defconfig +1 -0
diff -u --new-file --recursive linux-2.4.3-ac2.orig/arch/ppc/configs/SPD823TS_defconfig linux-2.4.3-ac2/arch/ppc/configs/SPD823TS_defconfig
@@ -414,3 +414,4 @@
 # CONFIG_MAGIC_SYSRQ is not set
 # CONFIG_KGDB is not set
 # CONFIG_XMON is not set
+CONFIG_PRINTK_BUF_LEN=16
arch/ppc/configs/TQM823L_defconfig +1 -0
diff -u --new-file --recursive linux-2.4.3-ac2.orig/arch/ppc/configs/TQM823L_defconfig linux-2.4.3-ac2/arch/ppc/configs/TQM823L_defconfig
@@ -417,3 +417,4 @@
 # CONFIG_MAGIC_SYSRQ is not set
 # CONFIG_KGDB is not set
 # CONFIG_XMON is not set
+CONFIG_PRINTK_BUF_LEN=16
arch/ppc/configs/TQM850L_defconfig +1 -0
diff -u --new-file --recursive linux-2.4.3-ac2.orig/arch/ppc/configs/TQM850L_defconfig linux-2.4.3-ac2/arch/ppc/configs/TQM850L_defconfig
@@ -417,3 +417,4 @@
 # CONFIG_MAGIC_SYSRQ is not set
 # CONFIG_KGDB is not set
 # CONFIG_XMON is not set
+CONFIG_PRINTK_BUF_LEN=16
arch/ppc/configs/TQM860L_defconfig +1 -0
diff -u --new-file --recursive linux-2.4.3-ac2.orig/arch/ppc/configs/TQM860L_defconfig linux-2.4.3-ac2/arch/ppc/configs/TQM860L_defconfig
@@ -417,3 +417,4 @@
 # CONFIG_MAGIC_SYSRQ is not set
 # CONFIG_KGDB is not set
 # CONFIG_XMON is not set
+CONFIG_PRINTK_BUF_LEN=16
arch/ppc/configs/apus_defconfig +1 -0
diff -u --new-file --recursive linux-2.4.3-ac2.orig/arch/ppc/configs/apus_defconfig linux-2.4.3-ac2/arch/ppc/configs/apus_defconfig
@@ -598,3 +598,4 @@
 # CONFIG_MAGIC_SYSRQ is not set
 # CONFIG_KGDB is not set
 # CONFIG_XMON is not set
+CONFIG_PRINTK_BUF_LEN=16
arch/ppc/configs/bseip_defconfig +1 -0
diff -u --new-file --recursive linux-2.4.3-ac2.orig/arch/ppc/configs/bseip_defconfig linux-2.4.3-ac2/arch/ppc/configs/bseip_defconfig
@@ -430,3 +430,4 @@
 # CONFIG_MAGIC_SYSRQ is not set
 # CONFIG_KGDB is not set
 # CONFIG_XMON is not set
+CONFIG_PRINTK_BUF_LEN=16
arch/ppc/configs/common_defconfig +1 -0
diff -u --new-file --recursive linux-2.4.3-ac2.orig/arch/ppc/configs/common_defconfig linux-2.4.3-ac2/arch/ppc/configs/common_defconfig
@@ -838,3 +838,4 @@
 CONFIG_MAGIC_SYSRQ=y
 # CONFIG_KGDB is not set
 CONFIG_XMON=y
+CONFIG_PRINTK_BUF_LEN=16
arch/ppc/configs/est8260_defconfig +1 -0
diff -u --new-file --recursive linux-2.4.3-ac2.orig/arch/ppc/configs/est8260_defconfig linux-2.4.3-ac2/arch/ppc/configs/est8260_defconfig
@@ -413,3 +413,4 @@
 # CONFIG_MAGIC_SYSRQ is not set
 # CONFIG_KGDB is not set
 # CONFIG_XMON is not set
+CONFIG_PRINTK_BUF_LEN=16
arch/ppc/configs/ibmchrp_defconfig +1 -0
diff -u --new-file --recursive linux-2.4.3-ac2.orig/arch/ppc/configs/ibmchrp_defconfig linux-2.4.3-ac2/arch/ppc/configs/ibmchrp_defconfig
@@ -634,3 +634,4 @@
 CONFIG_MAGIC_SYSRQ=y
 # CONFIG_KGDB is not set
 CONFIG_XMON=y
+CONFIG_PRINTK_BUF_LEN=16
arch/ppc/configs/mbx_defconfig +1 -0
diff -u --new-file --recursive linux-2.4.3-ac2.orig/arch/ppc/configs/mbx_defconfig linux-2.4.3-ac2/arch/ppc/configs/mbx_defconfig
@@ -422,3 +422,4 @@
 # CONFIG_MAGIC_SYSRQ is not set
 # CONFIG_KGDB is not set
 # CONFIG_XMON is not set
+CONFIG_PRINTK_BUF_LEN=16
arch/ppc/configs/oak_defconfig +1 -0
diff -u --new-file --recursive linux-2.4.3-ac2.orig/arch/ppc/configs/oak_defconfig linux-2.4.3-ac2/arch/ppc/configs/oak_defconfig
@@ -393,3 +393,4 @@
 # CONFIG_MAGIC_SYSRQ is not set
 # CONFIG_KGDB is not set
 # CONFIG_XMON is not set
+CONFIG_PRINTK_BUF_LEN=16
arch/ppc/configs/power3_defconfig +1 -0
diff -u --new-file --recursive linux-2.4.3-ac2.orig/arch/ppc/configs/power3_defconfig linux-2.4.3-ac2/arch/ppc/configs/power3_defconfig
@@ -660,3 +660,4 @@
 CONFIG_MAGIC_SYSRQ=y
 # CONFIG_KGDB is not set
 CONFIG_XMON=y
+CONFIG_PRINTK_BUF_LEN=16
arch/ppc/configs/rpxcllf_defconfig +1 -0
diff -u --new-file --recursive linux-2.4.3-ac2.orig/arch/ppc/configs/rpxcllf_defconfig linux-2.4.3-ac2/arch/ppc/configs/rpxcllf_defconfig
@@ -429,3 +429,4 @@
 # CONFIG_MAGIC_SYSRQ is not set
 # CONFIG_KGDB is not set
 # CONFIG_XMON is not set
+CONFIG_PRINTK_BUF_LEN=16
arch/ppc/configs/rpxlite_defconfig +1 -0
diff -u --new-file --recursive linux-2.4.3-ac2.orig/arch/ppc/configs/rpxlite_defconfig linux-2.4.3-ac2/arch/ppc/configs/rpxlite_defconfig
@@ -429,3 +429,4 @@
 # CONFIG_MAGIC_SYSRQ is not set
 # CONFIG_KGDB is not set
 # CONFIG_XMON is not set
+CONFIG_PRINTK_BUF_LEN=16
arch/ppc/configs/walnut_defconfig +1 -0
diff -u --new-file --recursive linux-2.4.3-ac2.orig/arch/ppc/configs/walnut_defconfig linux-2.4.3-ac2/arch/ppc/configs/walnut_defconfig
@@ -396,3 +396,4 @@
 # CONFIG_MAGIC_SYSRQ is not set
 # CONFIG_KGDB is not set
 # CONFIG_XMON is not set
+CONFIG_PRINTK_BUF_LEN=16
arch/ppc/defconfig +2 -0
diff -u --new-file --recursive linux-2.4.3-ac2.orig/arch/ppc/defconfig linux-2.4.3-ac2/arch/ppc/defconfig
@@ -837,3 +837,5 @@
 CONFIG_MAGIC_SYSRQ=y
 # CONFIG_KGDB is not set
 CONFIG_XMON=y
+CONFIG_PRINTK_BUF_LEN=16
+
arch/s390/config.in +1 -0
diff -u --new-file --recursive linux-2.4.3-ac2.orig/arch/s390/config.in linux-2.4.3-ac2/arch/s390/config.in
@@ -66,5 +66,6 @@
   bool 'Remote GDB kernel debugging' CONFIG_REMOTE_DEBUG
 fi
 # this does not work. bool 'Magic SysRq key' CONFIG_MAGIC_SYSRQ
+int 'Printk buffer size (in K bytes)' CONFIG_PRINTK_BUF_LEN 16
 endmenu
 
arch/s390/defconfig +1 -0
diff -u --new-file --recursive linux-2.4.3-ac2.orig/arch/s390/defconfig linux-2.4.3-ac2/arch/s390/defconfig
@@ -218,3 +218,4 @@
 #
 # Kernel hacking
 #
+CONFIG_PRINTK_BUF_LEN=16
arch/s390x/config.in +1 -0
diff -u --new-file --recursive linux-2.4.3-ac2.orig/arch/s390x/config.in linux-2.4.3-ac2/arch/s390x/config.in
@@ -69,5 +69,6 @@
   bool 'Remote GDB kernel debugging' CONFIG_REMOTE_DEBUG
 fi
 # this does not work. bool 'Magic SysRq key' CONFIG_MAGIC_SYSRQ
+int 'Printk buffer size (in K bytes)' CONFIG_PRINTK_BUF_LEN 16
 endmenu
 
arch/s390x/defconfig +1 -0
diff -u --new-file --recursive linux-2.4.3-ac2.orig/arch/s390x/defconfig linux-2.4.3-ac2/arch/s390x/defconfig
@@ -217,3 +217,4 @@
 #
 # Kernel hacking
 #
+CONFIG_PRINTK_BUF_LEN=16
arch/sh/config.in +1 -0
diff -u --new-file --recursive linux-2.4.3-ac2.orig/arch/sh/config.in linux-2.4.3-ac2/arch/sh/config.in
@@ -265,4 +265,5 @@
    bool 'GDB Stub kernel debug' CONFIG_DEBUG_KERNEL_WITH_GDB_STUB
    bool 'Early printk support' CONFIG_SH_EARLY_PRINTK
 fi
+int 'Printk buffer size (in K bytes)' CONFIG_PRINTK_BUF_LEN 16
 endmenu
arch/sh/defconfig +1 -0
diff -u --new-file --recursive linux-2.4.3-ac2.orig/arch/sh/defconfig linux-2.4.3-ac2/arch/sh/defconfig
@@ -204,3 +204,4 @@
 CONFIG_DEBUG_KERNEL_WITH_GDB_STUB=y
 CONFIG_GDB_STUB_VBR=a0000000
 CONFIG_SH_EARLY_PRINTK=y
+CONFIG_PRINTK_BUF_LEN=16
arch/sparc/config.in +1 -0
diff -u --new-file --recursive linux-2.4.3-ac2.orig/arch/sparc/config.in linux-2.4.3-ac2/arch/sparc/config.in
@@ -261,4 +261,5 @@
 comment 'Kernel hacking'
 
 bool 'Magic SysRq key' CONFIG_MAGIC_SYSRQ
+int 'Printk buffer size (in K bytes)' CONFIG_PRINTK_BUF_LEN 16
 endmenu
arch/sparc/defconfig +1 -0
diff -u --new-file --recursive linux-2.4.3-ac2.orig/arch/sparc/defconfig linux-2.4.3-ac2/arch/sparc/defconfig
@@ -381,3 +381,4 @@
 # Kernel hacking
 #
 # CONFIG_MAGIC_SYSRQ is not set
+CONFIG_PRINTK_BUF_LEN=16
arch/sparc64/config.in +1 -0
diff -u --new-file --recursive linux-2.4.3-ac2.orig/arch/sparc64/config.in linux-2.4.3-ac2/arch/sparc64/config.in
@@ -349,4 +349,5 @@
 
 bool 'Magic SysRq key' CONFIG_MAGIC_SYSRQ
 #bool 'ECache flush trap support at ta 0x72' CONFIG_EC_FLUSH_TRAP
+int 'Printk buffer size (in K bytes)' CONFIG_PRINTK_BUF_LEN 16
 endmenu
arch/sparc64/defconfig +2 -0
diff -u --new-file --recursive linux-2.4.3-ac2.orig/arch/sparc64/defconfig linux-2.4.3-ac2/arch/sparc64/defconfig
@@ -640,3 +640,5 @@
 # Kernel hacking
 #
 # CONFIG_MAGIC_SYSRQ is not set
+CONFIG_PRINTK_BUF_LEN=16
+
kernel/printk.c +1 -1
diff -u --new-file --recursive linux-2.4.3-ac2.orig/kernel/printk.c linux-2.4.3-ac2/kernel/printk.c
@@ -27,7 +27,7 @@
 
 #include <asm/uaccess.h>
 
-#define LOG_BUF_LEN	(16384)			/* This must be a power of two */
+#define LOG_BUF_LEN (CONFIG_PRINTK_BUF_LEN*1024) /* This must be a power of two */
 #define LOG_BUF_MASK	(LOG_BUF_LEN-1)
 
 /* printk's without a loglevel use this.. */
#1 lore raw

"Thomas Dodd wrote:"

kernel/printk.c line 32

Quoted 11 lines

diff -u --new-file --recursive linux-2.4.3-ac2.orig/kernel/printk.c linux-2.4.3-ac2/kernel/printk.c

kernel/printk.c +1 -1
@@ -27,7 +27,7 @@
 
 #include <asm/uaccess.h>
 
-#define LOG_BUF_LEN	(16384)			/* This must be a power of two */
+#define LOG_BUF_LEN (CONFIG_PRINTK_BUF_LEN*1024) /* This must be a power of two */
 #define LOG_BUF_MASK	(LOG_BUF_LEN-1)
 

IMO, it would be nice to add a test here whether the CONFIG_PRINTK_BUF_LEN value is really set as a power of two, eg.:

#if (LOG_BUF_LEN & LOG_BUF_MASK)
#error CONFIG_PRINTK_BUF_LEN must be a power of two #endif

(above works with egcs-2.91.66)

Andrzej

#2 lore raw
Quoted 7 lines · Andrzej Krzysztofowicz

IMO, it would be nice to add a test here whether the CONFIG_PRINTK_BUF_LEN value is really set as a power of two, eg.:

#if (LOG_BUF_LEN & LOG_BUF_MASK)
#error CONFIG_PRINTK_BUF_LEN must be a power of two #endif

I couldn't figure out how to do it in the config, forgot about preprocessing. But Alan wants a menu option instead.

Anyone who uses the embedded systems want a different default? Let me know and I'll put it in the default config files.
I'm sure a small hand held with fixed devices doesn't need even a 8K buffer. Just don't know which ones.

-Thomas