Date: Sat, 1 Mar 2003 20:53:53 -0500 From: Hiten Pandya <hiten@unixdaemons.com> To: current@FreeBSD.ORG Subject: Possible patch for limiting APs at startup Message-ID: <20030302015353.GA68661@unixdaemons.com>
next in thread | raw e-mail | index | archive | help
--/9DWx/yDrRhgMJTb
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Hello.
Just as the topic says, do you think this patch is good enough, or gets
even close to it? I have tested the patch, and it seems to do it's job
in the right way. Some might call it hackery, but it's better than
nothing I would suppose.
Before:
FreeBSD/SMP: Multiprocessor System Detected: 2 CPUs
cpu0 (BSP): apic id: 0, version: 0x00040011, at 0xfee00000
cpu1 (AP): apic id: 1, version: 0x00040011, at 0xfee00000
... Launch AP CPUs etc ...
After:
boot-prompt> set machdep.smp_cpus=0
boot-prompt> boot -sv
FreeBSD/SMP: Multiprocessor System Detected: 1 CPUs
cpu0 (BSP): apic id: 0, version: 0x00040011, at 0xfee00000
Patch attached with mail.
Cheers.
P.S. One more question, there are some extern variables in the
i386/include/smp.h header file, and I don't think they are used
anywhere in an extern way... can comment on patch available at the
following location:
http://www.unixdaemons.com/~hiten/work/diffs/eremove.patch
--
Hiten Pandya (hiten@unixdaemons.com, hiten@uk.FreeBSD.org)
http://www.unixdaemons.com/~hiten/
--/9DWx/yDrRhgMJTb
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="mp_machdep.c.patch"
Index: sys/i386/i386/mp_machdep.c
===================================================================
RCS file: /home/ncvs/src/sys/i386/i386/mp_machdep.c,v
retrieving revision 1.203
diff -u -r1.203 mp_machdep.c
--- sys/i386/i386/mp_machdep.c 24 Feb 2003 14:36:03 -0000 1.203
+++ sys/i386/i386/mp_machdep.c 2 Mar 2003 01:25:10 -0000
@@ -278,6 +278,9 @@
int io_num_to_apic_id[NAPICID];
int apic_id_to_logical[NAPICID];
+TUNABLE_INT("machdep.smp_cpus", (int *)&mp_naps);
+SYSCTL_INT(_machdep, OID_AUTO, smp_cpus, CTLFLAG_RD,
+ &mp_naps, 1, "Number of Application processors in use.");
/* AP uses this during bootstrap. Do not staticize. */
char *bootSTK;
--/9DWx/yDrRhgMJTb--
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030302015353.GA68661>
