Date: Sat, 06 Oct 2001 00:58:21 -0700 From: Peter Wemm <peter@wemm.org> To: Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp> Cc: John Baldwin <jhb@FreeBSD.ORG>, smp@FreeBSD.ORG, Alfred Perlstein <bright@mu.org> Subject: Re: How to distinguish the SMP kernel and the UP kernel Message-ID: <20011006075821.BCEDA380A@overcee.netplex.com.au> In-Reply-To: <200110060625.PAA02451@zodiac.mech.utsunomiya-u.ac.jp>
next in thread | previous in thread | raw e-mail | index | archive | help
Kazutaka YOKOTA wrote: > > >> - 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 looki ng > >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 thi s. > > > >Now, ideally kernel modules shouldn't care if they are on a SMP kernel or no t. > > 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 mor e. > > This is fine, as I am not very much interested in exposing to the userland > which kernel configration, SMP or UP, is running. I need to commit my config / build changes that build the kernel and modules with identical compile options. Remember, tuned modules go into /boot/kernel/* next to /boot/kernel/kernel. ie: this will not be a problem at all once this is committed since the module in question will have the SMP and/or APIC_IO ifdefs available. generic portable modules go in /boot/modules and dont get renamed away with a new kernel install. Things that need #ifdef SMP etc cannot go here. Cheers, -Peter -- Peter Wemm - peter@FreeBSD.org; peter@yahoo-inc.com; peter@netplex.com.au "All of this is for nothing if we don't go to the stars" - JMS/B5 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?20011006075821.BCEDA380A>