Date: Thu, 4 Oct 2001 13:00:51 -0500 From: Alfred Perlstein <bright@mu.org> To: Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp> Cc: smp@freebsd.org Subject: Re: How to distinguish the SMP kernel and the UP kernel Message-ID: <20011004130051.B59854@elvis.mu.org> In-Reply-To: <200110041211.VAA24646@zodiac.mech.utsunomiya-u.ac.jp>; from yokota@zodiac.mech.utsunomiya-u.ac.jp on Thu, Oct 04, 2001 at 09:11:30PM %2B0900 References: <200110030310.MAA13836@zodiac.mech.utsunomiya-u.ac.jp> <3BBB6757.9A668E99@mindspring.com> <200110041211.VAA24646@zodiac.mech.utsunomiya-u.ac.jp>
next in thread | previous in thread | raw e-mail | index | archive | help
* Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp> [011004 07:01] wrote: > > # 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? I'm quite sure you're right. It would probably make sense to have a sysctl that says weather or not MP is configured or not. -- -Alfred Perlstein [alfred@freebsd.org] 'Instead of asking why a piece of software is using "1970s technology," start asking why software is ignoring 30 years of accumulated wisdom.' 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?20011004130051.B59854>