Date: Thu, 04 Oct 2001 21:11:30 +0900 From: Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp> To: smp@freebsd.org Cc: yokota@zodiac.mech.utsunomiya-u.ac.jp Subject: Re: How to distinguish the SMP kernel and the UP kernel Message-ID: <200110041211.VAA24646@zodiac.mech.utsunomiya-u.ac.jp> In-Reply-To: Your message of "Wed, 03 Oct 2001 12:30:31 MST." <3BBB6757.9A668E99@mindspring.com> References: <200110030310.MAA13836@zodiac.mech.utsunomiya-u.ac.jp> <3BBB6757.9A668E99@mindspring.com>
next in thread | previous in thread | raw e-mail | index | archive | help
# moved to smp ML, to which this thread should have been posted # in the first place :-) >Kazutaka YOKOTA wrote: >> >> Is there any way for the loadable module to detect if >> the kernel is configured for SMP or UP? > >There is a global variable, "ncpu". Its name may have changed >recently, so you will want to look at the SYSCTL() stuff in >/sys/i386/i386 to be sure. > >-- Terry The sysctl variable hw.ncpu returns 1 in the UP kernel, and returns the number of active CPUs in the SMP kernel. When hw.ncpu == 1, it doesn't necessarily signifies the kernel is configured for UP. Because it is perfectly permissible to run the SMP kernel on the multi-CPU motherboard with only one CPU installed... Am I wrong? Kazu To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-smp" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200110041211.VAA24646>