public inbox for util-linux@vger.kernel.org
 help / color / mirror / Atom feed
* detecting SMP CPU
@ 2013-09-27 15:04 Helmut Hullen
  2013-11-07 11:45 ` Karel Zak
  0 siblings, 1 reply; 3+ messages in thread
From: Helmut Hullen @ 2013-09-27 15:04 UTC (permalink / raw)
  To: util-linux

Hallo, util-linux,

I want to detect the existence of an SMP CPU (multi core CPU). I've  
tried the contents of "/proc/cpuinfo" and the output of "lscpu".

Both ways only showed the existence of both processors of my AMD CPU  
when I run them under a kernel which was compiled with the option  
"SMP=Y".

The "help" for this kernel option proposes to set this option only if  
the kernel really runs on such a CPU.

Is there any way to detect a multi core CPU under a kernel which is  
compiled with "SMP=n"?

Please excuse my gerlish.

Viele Gruesse!
Helmut

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: detecting SMP CPU
  2013-09-27 15:04 detecting SMP CPU Helmut Hullen
@ 2013-11-07 11:45 ` Karel Zak
  2013-11-07 17:24   ` Helmut Hullen
  0 siblings, 1 reply; 3+ messages in thread
From: Karel Zak @ 2013-11-07 11:45 UTC (permalink / raw)
  To: helmut; +Cc: util-linux

On Fri, Sep 27, 2013 at 05:04:00PM +0200, Helmut Hullen wrote:
> I want to detect the existence of an SMP CPU (multi core CPU). I've  
> tried the contents of "/proc/cpuinfo" and the output of "lscpu".
> 
> Both ways only showed the existence of both processors of my AMD CPU  
> when I run them under a kernel which was compiled with the option  
> "SMP=Y".
> 
> The "help" for this kernel option proposes to set this option only if  
> the kernel really runs on such a CPU.
> 
> Is there any way to detect a multi core CPU under a kernel which is  
> compiled with "SMP=n"?

 If you don't want to rely on kernel information than you probably
 have to use CPUID and some assembler magic to get CPU topology

 http://wiki.osdev.org/Detecting_CPU_Topology_(80x86)

 or maybe you can use CPU flags from /proc/cpuinfo (I guess the flags 
 does not depend on SMP=y/n.

 It's probably better to ask at lkml :-)

    Karel

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: detecting SMP CPU
  2013-11-07 11:45 ` Karel Zak
@ 2013-11-07 17:24   ` Helmut Hullen
  0 siblings, 0 replies; 3+ messages in thread
From: Helmut Hullen @ 2013-11-07 17:24 UTC (permalink / raw)
  To: util-linux

Hallo, Karel,

Du meintest am 07.11.13:

>> I want to detect the existence of an SMP CPU (multi core CPU). I've
>> tried the contents of "/proc/cpuinfo" and the output of "lscpu".

[...]

>> Is there any way to detect a multi core CPU under a kernel which is
>> compiled with "SMP=n"?

>  If you don't want to rely on kernel information than you probably
>  have to use CPUID and some assembler magic to get CPU topology

>  http://wiki.osdev.org/Detecting_CPU_Topology_(80x86)

>  or maybe you can use CPU flags from /proc/cpuinfo (I guess the flags
>  does not depend on SMP=y/n.

>  It's probably better to ask at lkml :-)

Thank you - i'm still (re-)searching.

Viele Gruesse!
Helmut

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-11-07 17:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-27 15:04 detecting SMP CPU Helmut Hullen
2013-11-07 11:45 ` Karel Zak
2013-11-07 17:24   ` Helmut Hullen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox