Date: Sat, 06 Oct 2001 15:25:40 +0900 From: Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp> To: John Baldwin <jhb@freebsd.org> Cc: smp@freebsd.org, Alfred Perlstein <bright@mu.org>, yokota@zodiac.mech.utsunomiya-u.ac.jp Subject: Re: How to distinguish the SMP kernel and the UP kernel Message-ID: <200110060625.PAA02451@zodiac.mech.utsunomiya-u.ac.jp> In-Reply-To: Your message of "Fri, 05 Oct 2001 09:12:46 MST." <XFMail.011005091246.jhb@FreeBSD.org> References: <XFMail.011005091246.jhb@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
>> - The following patch will add a new sysctl variable. >> >> kern.smp.kernel >> >> This will be 0 for the UP kernel and 1 for the SMP kernel. >> >> - It also make kern.smp.active available in the UP kernel as well. >> (Previously this sysctl variable was only present in the SMP >> kernel.) It will always be 0 for the UP kernel. > >This shouldn't be done. There's no need for 2 copies of the same sysctl. >Actually, userland can _already_ tell if it is an SMP kernel or not by looking >if the kern.smp.active sysctl exists. This is how top works, for example. >Thus, userland doesn't need any of this. Only in the kernel do you need this. > >Now, ideally kernel modules shouldn't care if they are on a SMP kernel or not. I agree. But, some modules need to know ;-< I was trying to make the pnpbios driver into a module and it has #ifdef SMP in it. >Why does the module in question care? The only thing I would do here is >possibly export a global variable saying if SMP was compiled in, nothing more. This is fine, as I am not very much interested in exposing to the userland which kernel configration, SMP or UP, is running. 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?200110060625.PAA02451>