Re: How to Determine Which Kernel

From: David Woodhouse (dwmw2@infradead.org)
Date: Sat Apr 01 2000 - 05:14:34 EST


root@chaos.analogic.com said:

> On Fri, 31 Mar 2000, [iso-8859-1] Quang Nguyêñ (formerly Ngô) wrote:
> > How do you determine from the user level whether you are running under the
> > SMP or UP kernel? Is there a function call for it? I know there is
> > __SMP__, but I want to check it dynamically.

> `cat /proc/cpuinfo`
> `uname -a`

Note that these two return different information, either of which might be
what you were after.

The output of `uname -a` will tell you whether the kernel was compiled with
SMP support, regardless of how many CPUs are actually present.

The contents of /proc/cpuinfo will tell you how many processors are active in
the current system - if it's more than one then you're obviously on an SMP
kernel, but if it equals one, then you might be using an SMP kernel on a UP
machine, or a UP kernel on an SMP machine.

--
dwmw2

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Apr 07 2000 - 21:00:07 EST