Skip to contentSkip to conversation

Detecting SMP in user space

Linux-ia64 Andreas Schwab 3 participants 5 messages Apr 19, 2001 – Apr 20, 2001

lore
Share & tools
lore
#0 lore raw

How can I detect an SMP system in user space even when running an UP kernel? Things like `cat /proc/cpuinfo' don't count.

Andreas.

Signature · 5 lines
Andreas Schwab                                  "And now for something
SuSE Labs                                        completely different."
[email protected]
SuSE GmbH, Schanzäckerstr. 10, D-90443 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
#1 lore raw

How about simply running 'top' or a 'dmesg | grep CPU'?

-----Original Message-----
From: Andreas Schwab [mailto:[email protected]]
Sent: Thursday, April 19, 2001 4:45 AM
To: [email protected]
Subject: [Linux-ia64] Detecting SMP in user space

How can I detect an SMP system in user space even when running an UP kernel? Things like `cat /proc/cpuinfo' don't count.

Andreas.

Signature · 10 lines
Andreas Schwab                                  "And now for something
SuSE Labs                                        completely different."
[email protected]
SuSE GmbH, Schanzäckerstr. 10, D-90443 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5

_______________________________________________
Linux-IA64 mailing list
[email protected]
http://lists.linuxia64.org/lists/listinfo/linux-ia64
#2 lore raw
In reply to Andreas Schwab

"McCaffity, Ray" <[email protected]> writes:

|> How about simply running 'top' or a 'dmesg | grep CPU'?

As I already said, I'm running a UP kernel, thus top only ever sees one CPU. The latter fails if the boot messages have already been cleared from the kernel log.

Andreas.

Signature · 5 lines
Andreas Schwab                                  "And now for something
SuSE Labs                                        completely different."
[email protected]
SuSE GmbH, Schanzäckerstr. 10, D-90443 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
#3 lore raw
In reply to Andreas Schwab

Hi,

Does this work?

/usr/bin/getconf _NPROCESSORS_ONLN

Quoted 16 lines · Andreas Schwab

How can I detect an SMP system in user space even when running an UP kernel? Things like `cat /proc/cpuinfo' don't count.

Andreas.

Signature · 10 lines
Andreas Schwab                                  "And now for something
SuSE Labs                                        completely different."
[email protected]
SuSE GmbH, Schanzäckerstr. 10, D-90443 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5

_______________________________________________
Linux-IA64 mailing list
[email protected]
http://lists.linuxia64.org/lists/listinfo/linux-ia64
Signature · 3 lines
Mike Madore
Software Engineer
TurboLinux, Inc.
#4 lore raw
In reply to Andreas Schwab

Michael Madore <[email protected]> writes:

|> Hi,
|> 
|> Does this work?
|> 
|> /usr/bin/getconf _NPROCESSORS_ONLN

This is just another instance of the `cat /proc/cpuinfo' class.

Andreas.

Signature · 5 lines
Andreas Schwab                                  "And now for something
SuSE Labs                                        completely different."
[email protected]
SuSE GmbH, Schanzäckerstr. 10, D-90443 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5