From owner-freebsd-current Sat Mar 1 17:54: 2 2003 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 71C8137B405 for ; Sat, 1 Mar 2003 17:54:00 -0800 (PST) Received: from angelica.unixdaemons.com (angelica.unixdaemons.com [209.148.64.135]) by mx1.FreeBSD.org (Postfix) with ESMTP id A00A443FF5 for ; Sat, 1 Mar 2003 17:53:58 -0800 (PST) (envelope-from hiten@angelica.unixdaemons.com) Received: from angelica.unixdaemons.com (localhost.unixdaemons.com [127.0.0.1]) by angelica.unixdaemons.com (8.12.7/8.12.1) with ESMTP id h221rrjL071019; Sat, 1 Mar 2003 20:53:53 -0500 (EST) Received: (from hiten@localhost) by angelica.unixdaemons.com (8.12.7/8.12.1/Submit) id h221rrmS071018; Sat, 1 Mar 2003 20:53:53 -0500 (EST) (envelope-from hiten) Date: Sat, 1 Mar 2003 20:53:53 -0500 From: Hiten Pandya To: current@FreeBSD.ORG Subject: Possible patch for limiting APs at startup Message-ID: <20030302015353.GA68661@unixdaemons.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="/9DWx/yDrRhgMJTb" Content-Disposition: inline User-Agent: Mutt/1.4i X-Operating-System: FreeBSD i386 X-Public-Key: http://www.pittgoth.com/~hiten/pubkey.asc X-URL: http://www.unixdaemons.com/~hiten X-PGP: http://pgp.mit.edu:11371/pks/lookup?search=Hiten+Pandya&op=index Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --/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