From: Karel Zak <kzak@redhat.com>
To: helmut@hullen.de
Cc: util-linux@vger.kernel.org
Subject: Re: detecting SMP CPU
Date: Thu, 7 Nov 2013 12:45:56 +0100 [thread overview]
Message-ID: <20131107114556.GB2853@x2.net.home> (raw)
In-Reply-To: <CedICKtuCXB@helmut.hullen.de>
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
next prev parent reply other threads:[~2013-11-07 11:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-27 15:04 detecting SMP CPU Helmut Hullen
2013-11-07 11:45 ` Karel Zak [this message]
2013-11-07 17:24 ` Helmut Hullen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20131107114556.GB2853@x2.net.home \
--to=kzak@redhat.com \
--cc=helmut@hullen.de \
--cc=util-linux@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox