public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] configurable LOG_BUF_SIZE
@ 2003-01-02 23:09 Randy.Dunlap
  2003-01-06 18:50 ` Tom Rini
  0 siblings, 1 reply; 18+ messages in thread
From: Randy.Dunlap @ 2003-01-02 23:09 UTC (permalink / raw)
  To: linux-kernel; +Cc: torvalds


Hi,

This patch to 2.5.54 make LOG_BUF_LEN a configurable option.
Actually its shift value is configurable, and that keeps it
a power of 2.

Please apply.

Thanks,
-- 
~Randy



patch_name:	logbuf-config-2554.patch
patch_version:	2003.01.02
author:		Randy Dunlap <rddunlap@osdl.org>
description:	change LOG_BUF_LEN to a config option (LOG_BUF_SHIFT)
product:	linux
product_versions: 2.5.54
changelog:	(a) add in General Setup
		(b) use a SHIFT value (enforces power of 2, gives more choices)
URL:		http://www.osdl.org/archive/rddunlap/patches/
requires:	kconfig in 2.5.52 or later
conflicts:
diffstat:
 init/Kconfig    |   45 +++++++++++++++++++++++++++++++++++++++++++++
 kernel/printk.c |   11 +----------
 2 files changed, 46 insertions(+), 10 deletions(-)


--- ./kernel/printk.c%LOG	Wed Jan  1 19:23:19 2003
+++ ./kernel/printk.c	Thu Jan  2 14:48:59 2003
@@ -31,16 +31,7 @@

 #include <asm/uaccess.h>

-#if defined(CONFIG_X86_NUMAQ) || defined(CONFIG_IA64)
-#define LOG_BUF_LEN	(65536)
-#elif defined(CONFIG_ARCH_S390)
-#define LOG_BUF_LEN	(131072)
-#elif defined(CONFIG_SMP)
-#define LOG_BUF_LEN	(32768)
-#else
-#define LOG_BUF_LEN	(16384)			/* This must be a power of two */
-#endif
-
+#define LOG_BUF_LEN	(1 << CONFIG_LOG_BUF_SHIFT)	/* This must be a power of two */
 #define LOG_BUF_MASK	(LOG_BUF_LEN-1)

 /* printk's without a loglevel use this.. */
--- ./init/Kconfig%LOG	Thu Jan  2 14:34:27 2003
+++ ./init/Kconfig	Thu Jan  2 14:42:01 2003
@@ -98,6 +98,51 @@
 	  building a kernel for install/rescue disks or your system is very
 	  limited in memory.

+choice
+	prompt "Kernel log buffer size"
+	default LOG_BUF_SHIFT_17 if ARCH_S390
+	default LOG_BUF_SHIFT_16 if X86_NUMAQ || IA64
+	default LOG_BUF_SHIFT_15 if SMP
+	default LOG_BUF_SHIFT_14
+	help
+	  Select kernel log buffer size from this list (power of 2).
+	  Defaults:  17 (=> 128 KB for S/390)
+		     16 (=> 64 KB for x86 NUMAQ or IA-64)
+	             15 (=> 32 KB for SMP)
+	             14 (=> 16 KB for uniprocessor)
+
+config LOG_BUF_SHIFT_17
+	bool "128 KB"
+	default y if ARCH_S390
+
+config LOG_BUF_SHIFT_16
+	bool "64 KB"
+	default y if X86_NUMAQ || IA64
+
+config LOG_BUF_SHIFT_15
+	bool "32 KB"
+	default y if SMP
+
+config LOG_BUF_SHIFT_14
+	bool "16 KB"
+
+config LOG_BUF_SHIFT_13
+	bool "8 KB"
+
+config LOG_BUF_SHIFT_12
+	bool "4 KB"
+
+endchoice
+
+config LOG_BUF_SHIFT
+	int
+	default 17 if LOG_BUF_SHIFT_17=y
+	default 16 if LOG_BUF_SHIFT_16=y
+	default 15 if LOG_BUF_SHIFT_15=y
+	default 14 if LOG_BUF_SHIFT_14=y
+	default 13 if LOG_BUF_SHIFT_13=y
+	default 12 if LOG_BUF_SHIFT_12=y
+
 endmenu




^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2003-01-07  0:38 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-01-02 23:09 [PATCH] configurable LOG_BUF_SIZE Randy.Dunlap
2003-01-06 18:50 ` Tom Rini
2003-01-06 18:57   ` Randy.Dunlap
2003-01-06 19:06     ` Tom Rini
2003-01-06 19:05       ` Randy.Dunlap
2003-01-06 19:15         ` Tom Rini
2003-01-06 19:16       ` Linus Torvalds
2003-01-06 19:20         ` Randy.Dunlap
2003-01-06 21:06           ` Randy.Dunlap
2003-01-06 21:26             ` Tomas Szepe
2003-01-06 22:04               ` Randy.Dunlap
2003-01-06 22:56                 ` Tom Rini
2003-01-06 23:30             ` [PATCH] configurable LOG_BUF_SIZE (updated) Randy.Dunlap
2003-01-06 23:57               ` Andrew Morton
2003-01-06 23:57                 ` Randy.Dunlap
2003-01-07  0:12                   ` Randy.Dunlap
2003-01-07  0:44                 ` [PATCH] configurable LOG_BUF_SIZE (update-2) Randy.Dunlap
2003-01-07  0:12             ` [PATCH] configurable LOG_BUF_SIZE Roman Zippel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox