* Re: Detecting SMP
@ 2001-02-21 17:05 Jay D Allen
0 siblings, 0 replies; 8+ messages in thread
From: Jay D Allen @ 2001-02-21 17:05 UTC (permalink / raw)
To: Burton Windle; +Cc: linux-kernel
What is the platform ( x86, Sparc, alpha or ?)? On sparc look in the
bootprom (ls /proc/openprom) that works regardless of kernel SMP status.
On Intel I think your out of luck, at least with the commonly available
hardware/software. In theory there could be a bios-peeking structure in
/proc much like openprom that could give you hints...
Sent by: linux-kernel-owner@vger.kernel.org
To: linux-kernel@vger.kernel.org
cc:
Subject: Detecting SMP
Hello. Is there a way, when running a non-SMP kernel, to detect or
otherwise tell (software only; the machine is 2400 miles away) if the
system has SMP capibilties? Would /proc/cpuinfo show two CPUs if the
kernel is non-SMP? Thanks!
(btw, the kernel in question is a stock RH6.2 kernel 2.2.14-5, and yes, I
know I should update it anyways and that a SMP kernel will run on a UP
system)
--
Burton Windle burton@fint.org
Linux: the "grim reaper of innocent orphaned children."
from /usr/src/linux-2.4.0/init/main.c:655
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Detecting SMP
2001-02-21 0:15 Burton Windle
2001-02-21 17:48 ` Tigran Aivazian
@ 2001-02-24 13:44 ` Mike A. Harris
1 sibling, 0 replies; 8+ messages in thread
From: Mike A. Harris @ 2001-02-24 13:44 UTC (permalink / raw)
To: Burton Windle; +Cc: linux-kernel
On Tue, 20 Feb 2001, Burton Windle wrote:
>Hello. Is there a way, when running a non-SMP kernel, to detect or
>otherwise tell (software only; the machine is 2400 miles away) if the
>system has SMP capibilties? Would /proc/cpuinfo show two CPUs if the
>kernel is non-SMP? Thanks!
>
>(btw, the kernel in question is a stock RH6.2 kernel 2.2.14-5, and yes, I
>know I should update it anyways and that a SMP kernel will run on a UP
>system)
Yes, there are several ways. How do you want to know how to do
it, in C, or a bash script? sysconf is one way, parsing
/proc/cpuinfo and /proc/stat is another. Beware though, if you
parse /proc/cpuinfo or stat, it is very different on different
architectures, particularly sparc.
Here is some code which should do it more or less correctly on
any arch:
ncpus=$(egrep -c ^cpu[0-9]+ /proc/stat || :)
[ "$ncpus" = "0" ] && ncpus=1
----------------------------------------------------------------------
Mike A. Harris - Linux advocate - Free Software advocate
This message is copyright 2001, all rights reserved.
Views expressed are my own, not necessarily shared by my employer.
----------------------------------------------------------------------
if (argc > 1 && strcmp(argv[1], "-advice") == 0) {
printf("Don't Panic!\n");
exit(42);
}
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Detecting SMP
2001-02-21 18:01 ` Tigran Aivazian
@ 2001-02-22 10:16 ` Maciej W. Rozycki
0 siblings, 0 replies; 8+ messages in thread
From: Maciej W. Rozycki @ 2001-02-22 10:16 UTC (permalink / raw)
To: Tigran Aivazian; +Cc: Jeff Garzik, Burton Windle, linux-kernel
On Wed, 21 Feb 2001, Tigran Aivazian wrote:
> So, one would normally expect this to mean an SMP board rather than
> multiple processors, _HOWEVER_, I can imagine a very clever MP-aware BIOS
> implementation which detects that there are many processors and prepares
> MP floating config table and does _not_ prepare it otherwise. So, it all
> depends on the BIOS implementation.
I've seen systems that do so and while it's not forbidden I consider it a
bad thing. It prevents us from being able to use I/O APICs.
--
+ Maciej W. Rozycki, Technical University of Gdansk, Poland +
+--------------------------------------------------------------+
+ e-mail: macro@ds2.pg.gda.pl, PGP key available +
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Detecting SMP
2001-02-21 17:48 ` Tigran Aivazian
2001-02-21 17:52 ` Jeff Garzik
@ 2001-02-21 18:12 ` Tigran Aivazian
1 sibling, 0 replies; 8+ messages in thread
From: Tigran Aivazian @ 2001-02-21 18:12 UTC (permalink / raw)
To: Burton Windle; +Cc: linux-kernel
On Wed, 21 Feb 2001, Tigran Aivazian wrote:
> yes, just run the famous mptable program.
before I am snowed under with questions about where to get this program,
here is the src and binaries that I use -- it is quite possible that there
is a newer version (I suspect Ingo Molnar might know better :)
http://www.moses.uklinux.net/mptable
Regards,
Tigran
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Detecting SMP
2001-02-21 17:52 ` Jeff Garzik
@ 2001-02-21 18:01 ` Tigran Aivazian
2001-02-22 10:16 ` Maciej W. Rozycki
0 siblings, 1 reply; 8+ messages in thread
From: Tigran Aivazian @ 2001-02-21 18:01 UTC (permalink / raw)
To: Jeff Garzik; +Cc: Burton Windle, linux-kernel
On Wed, 21 Feb 2001, Jeff Garzik wrote:
> On Wed, 21 Feb 2001, Tigran Aivazian wrote:
> > yes, just run the famous mptable program. If the machine is SMP then it
> > will have a valid Intel MP 1.4 configuration tables so the program will
> > show meaningful output.
>
> Does that allow you to detect multiple processors... or just an SMP board?
>
the answer is in section 4.1 of the Intel MP 1.4 spec:
"An MP-compliant system must implement the MP floating pointer
structure, ..."
So, one would normally expect this to mean an SMP board rather than
multiple processors, _HOWEVER_, I can imagine a very clever MP-aware BIOS
implementation which detects that there are many processors and prepares
MP floating config table and does _not_ prepare it otherwise. So, it all
depends on the BIOS implementation.
Actually, I never tried unplugging all-1 processors from my SMP machines
and seeing what sort of MP table is left...
Regards,
Tigran
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Detecting SMP
2001-02-21 17:48 ` Tigran Aivazian
@ 2001-02-21 17:52 ` Jeff Garzik
2001-02-21 18:01 ` Tigran Aivazian
2001-02-21 18:12 ` Tigran Aivazian
1 sibling, 1 reply; 8+ messages in thread
From: Jeff Garzik @ 2001-02-21 17:52 UTC (permalink / raw)
To: Tigran Aivazian; +Cc: Burton Windle, linux-kernel
On Wed, 21 Feb 2001, Tigran Aivazian wrote:
> yes, just run the famous mptable program. If the machine is SMP then it
> will have a valid Intel MP 1.4 configuration tables so the program will
> show meaningful output.
Does that allow you to detect multiple processors... or just an SMP board?
Jeff
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Detecting SMP
2001-02-21 0:15 Burton Windle
@ 2001-02-21 17:48 ` Tigran Aivazian
2001-02-21 17:52 ` Jeff Garzik
2001-02-21 18:12 ` Tigran Aivazian
2001-02-24 13:44 ` Mike A. Harris
1 sibling, 2 replies; 8+ messages in thread
From: Tigran Aivazian @ 2001-02-21 17:48 UTC (permalink / raw)
To: Burton Windle; +Cc: linux-kernel
yes, just run the famous mptable program. If the machine is SMP then it
will have a valid Intel MP 1.4 configuration tables so the program will
show meaningful output.
Regards,
Tigran
On Tue, 20 Feb 2001, Burton Windle wrote:
> Hello. Is there a way, when running a non-SMP kernel, to detect or
> otherwise tell (software only; the machine is 2400 miles away) if the
> system has SMP capibilties? Would /proc/cpuinfo show two CPUs if the
> kernel is non-SMP? Thanks!
>
> (btw, the kernel in question is a stock RH6.2 kernel 2.2.14-5, and yes, I
> know I should update it anyways and that a SMP kernel will run on a UP
> system)
>
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Detecting SMP
@ 2001-02-21 0:15 Burton Windle
2001-02-21 17:48 ` Tigran Aivazian
2001-02-24 13:44 ` Mike A. Harris
0 siblings, 2 replies; 8+ messages in thread
From: Burton Windle @ 2001-02-21 0:15 UTC (permalink / raw)
To: linux-kernel
Hello. Is there a way, when running a non-SMP kernel, to detect or
otherwise tell (software only; the machine is 2400 miles away) if the
system has SMP capibilties? Would /proc/cpuinfo show two CPUs if the
kernel is non-SMP? Thanks!
(btw, the kernel in question is a stock RH6.2 kernel 2.2.14-5, and yes, I
know I should update it anyways and that a SMP kernel will run on a UP
system)
--
Burton Windle burton@fint.org
Linux: the "grim reaper of innocent orphaned children."
from /usr/src/linux-2.4.0/init/main.c:655
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2001-02-24 13:43 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-02-21 17:05 Detecting SMP Jay D Allen
-- strict thread matches above, loose matches on Subject: below --
2001-02-21 0:15 Burton Windle
2001-02-21 17:48 ` Tigran Aivazian
2001-02-21 17:52 ` Jeff Garzik
2001-02-21 18:01 ` Tigran Aivazian
2001-02-22 10:16 ` Maciej W. Rozycki
2001-02-21 18:12 ` Tigran Aivazian
2001-02-24 13:44 ` Mike A. Harris
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®