util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Masayoshi Mizuma <msys.mizuma@gmail.com>
To: util-linux@vger.kernel.org
Cc: Masayoshi Mizuma <msys.mizuma@gmail.com>
Subject: [PATCH 0/4] lscpu: Fix socket information on aarch64 machine
Date: Fri, 11 Sep 2020 09:53:24 -0400	[thread overview]
Message-ID: <20200911135328.1465-1-msys.mizuma@gmail.com> (raw)

lscpu may show the wrong number of physical sockets on aarch64 machine
as 'Socket(s)'.

That is because lscpu uses a sysfs entry (cpu/cpuX/topology/core_siblings) to
get the number of sockets. For aarch64, the sysfs entry is set from MPIDR_EL1
register if the machine doesn't have ACPI PPTT. According to ARM Architecture
Reference Manual, the register shows the topology as the affinity, but doesn't
show the physical socket information.

There're such aarch64 machines because ARM SBBR v1.0 and v1.1 don't require 
ACPI PPTT. SBBR v1.2 requires ACPI PPTT.

For the aarch64 machine, probably 'Cluster(s)' is good instead of 'Socket(s)'
according to linux/arch/arm64/kernel/topology.c:store_cpu_topology().

To get the number of sockets on the machine, SMBIOS Processor information (Type04)
is useful for lscpu because the SMBIOS information is a mandatory
feature for the aarch64 machine which is based on ARM SBBR v1.0 and newer.

With these patches, lscpu shows as following on the machine:

  For unprivileged user:
    $ lscpu 
    Architecture:                    aarch64
    ...
    Socket(s):                       -
    Cluster(s):                      4
    ...

  For root:
    # lscpu
    Architecture:                    aarch64
    ...
    Socket(s):                       1
    Cluster(s):                      4

Masayoshi Mizuma (4):
  lscpu: use cluster on aarch64 machine which doesn't have ACPI PPTT
  lscpu-dmi: split to parse dmi table
  lscpu: add helper to get physical sockets
  lscpu: show physical socket on aarch64 without ACPI PPTT

 sys-utils/lscpu-dmi.c | 90 +++++++++++++++++++++++++++++++++----------
 sys-utils/lscpu.1     |  3 ++
 sys-utils/lscpu.c     | 75 ++++++++++++++++++++++++++++++++----
 sys-utils/lscpu.h     |  1 +
 4 files changed, 142 insertions(+), 27 deletions(-)

-- 
2.27.0

             reply	other threads:[~2020-09-11 16:11 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-11 13:53 Masayoshi Mizuma [this message]
2020-09-11 13:53 ` [PATCH 1/4] lscpu: use cluster on aarch64 machine which doesn't have ACPI PPTT Masayoshi Mizuma
2020-09-11 13:53 ` [PATCH 2/4] lscpu-dmi: split to parse dmi table Masayoshi Mizuma
2020-09-11 13:53 ` [PATCH 3/4] lscpu: add helper to get physical sockets Masayoshi Mizuma
2020-09-11 13:53 ` [PATCH 4/4] lscpu: show physical socket on aarch64 without ACPI PPTT Masayoshi Mizuma
2020-09-14 10:10 ` [PATCH 0/4] lscpu: Fix socket information on aarch64 machine Karel Zak
2020-09-14 12:32   ` Masayoshi Mizuma
2020-11-13 17:12     ` Masayoshi Mizuma
2020-11-13 17:43       ` Karel Zak
2020-11-13 17:45         ` Karel Zak

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=20200911135328.1465-1-msys.mizuma@gmail.com \
    --to=msys.mizuma@gmail.com \
    --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;
as well as URLs for NNTP newsgroup(s).