[patch] CONFIG_SMP_NR

Andrea Arcangeli (andrea@e-mind.com)
Mon, 18 Jan 1999 23:40:20 +0100 (CET)


This patch against pre8-testing allow me to save some kbyte of memory
otherwise wasted. I could also hack tasks.h by hand but this looks nicer
with near zero overhead.

Index: arch/i386/config.in
===================================================================
RCS file: /var/cvs/linux/arch/i386/config.in,v
retrieving revision 1.1.2.2
diff -u -r1.1.2.2 config.in
--- config.in 1999/01/18 13:56:36 1.1.2.2
+++ linux/arch/i386/config.in 1999/01/18 22:23:37
@@ -36,6 +36,9 @@
bool 'Math emulation' CONFIG_MATH_EMULATION
bool 'MTRR (Memory Type Range Register) support' CONFIG_MTRR
bool 'Symmetric multi-processing support' CONFIG_SMP
+if [ "$CONFIG_SMP" = "y" ]; then
+ int ' Number of CPU' CONFIG_SMP_NR 32
+fi
endmenu

mainmenu_option next_comment
Index: include/linux/tasks.h
===================================================================
RCS file: /var/cvs/linux/include/linux/tasks.h,v
retrieving revision 1.1.2.1
diff -u -r1.1.2.1 tasks.h
--- tasks.h 1999/01/18 01:32:55 1.1.2.1
+++ linux/include/linux/tasks.h 1999/01/18 22:20:50
@@ -6,7 +6,12 @@
*/

#ifdef __SMP__
+#include <config/smp/nr.h>
+#ifdef CONFIG_SMP_NR
+#define NR_CPUS CONFIG_SMP_NR
+#else
#define NR_CPUS 32 /* Max processors that can be running in SMP */
+#endif
#else
#define NR_CPUS 1
#endif

Andrea Arcangeli

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/