All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cong Wang <xiyou.wangcong@gmail.com>
To: "JA Magallón" <jamagallonn@gmail.com>
Cc: Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: Question on /proc/cpuinfo
Date: Fri, 14 Sep 2012 20:30:15 +0800	[thread overview]
Message-ID: <50532357.50401@gmail.com> (raw)
In-Reply-To: <505269D5.30601@gmail.com>

On 09/14/2012 07:18 AM, JA Magallón wrote:
> Hi...
>
> Probably it is a stupid question, but... I wan to count the number of
> processors, cores and threads on a linux system. I do it by reading
> /proc/cpuinfo.
>
...
>
> Since when is it safe to read things the modern way (kernel version ?).
> Is there a better procedure to get this info ?
>

Probably lscpu(1) is better for you, on my laptop it outputs:

% lscpu
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                2
On-line CPU(s) list:   0,1
Thread(s) per core:    1
Core(s) per socket:    2
Socket(s):             1
NUMA node(s):          1
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 23
Stepping:              10
CPU MHz:               2401.000
BogoMIPS:              4788.03
Virtualization:        VT-x
L1d cache:             32K
L1i cache:             32K
L2 cache:              3072K
NUMA node0 CPU(s):     0,1


  reply	other threads:[~2012-09-14 12:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-13 23:18 Question on /proc/cpuinfo JA Magallón
2012-09-14 12:30 ` Cong Wang [this message]
2012-09-23 11:52   ` Jan Engelhardt
  -- strict thread matches above, loose matches on Subject: below --
2012-09-13 22:37 JA Magallón

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=50532357.50401@gmail.com \
    --to=xiyou.wangcong@gmail.com \
    --cc=jamagallonn@gmail.com \
    --cc=linux-kernel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.