dcavalca / rpms / util-linux

Forked from rpms/util-linux 2 years ago
Clone
df3f53
From ac6651b2bc599af707ccc96936bb028d31c1aea8 Mon Sep 17 00:00:00 2001
df3f53
From: Masayoshi Mizuma <m.mizuma@jp.fujitsu.com>
df3f53
Date: Fri, 11 Sep 2020 09:53:28 -0400
df3f53
Subject: [PATCH 54/56] lscpu: show physical socket on aarch64 without ACPI
df3f53
 PPTT
df3f53
df3f53
Show the number of physical socket even if the sysfs doesn't have
df3f53
the physical socket information.
df3f53
Note, lscpu cannot show the number of socket info for unprivileged
df3f53
users because it needs to access the DMI table.
df3f53
df3f53
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1883056
df3f53
Signed-off-by: Masayoshi Mizuma <m.mizuma@jp.fujitsu.com>
df3f53
Signed-off-by: Karel Zak <kzak@redhat.com>
df3f53
---
df3f53
 sys-utils/lscpu.c | 6 ++++--
df3f53
 sys-utils/lscpu.h | 1 -
df3f53
 2 files changed, 4 insertions(+), 3 deletions(-)
df3f53
df3f53
diff --git a/sys-utils/lscpu.c b/sys-utils/lscpu.c
df3f53
index a8b448fa0..dc6dc97c3 100644
df3f53
--- a/sys-utils/lscpu.c
df3f53
+++ b/sys-utils/lscpu.c
df3f53
@@ -1850,8 +1850,10 @@ print_summary(struct lscpu_desc *desc, struct lscpu_modifier *mod)
df3f53
 			}
df3f53
 		} else {
df3f53
 			if (desc->is_cluster) {
df3f53
-				if (desc->nr_socket_on_cluster > 0)
df3f53
-					add_summary_n(tb, _("Socket(s):"), desc->nr_socket_on_cluster);
df3f53
+				int sockets = get_number_of_physical_sockets_from_dmi();
df3f53
+
df3f53
+				if (sockets > 0)
df3f53
+					add_summary_n(tb, _("Socket(s):"), sockets);
df3f53
 				else
df3f53
 					add_summary_s(tb, _("Socket(s):"), "-");
df3f53
 
df3f53
diff --git a/sys-utils/lscpu.h b/sys-utils/lscpu.h
df3f53
index b190afd21..1aef8202d 100644
df3f53
--- a/sys-utils/lscpu.h
df3f53
+++ b/sys-utils/lscpu.h
df3f53
@@ -160,7 +160,6 @@ struct lscpu_desc {
df3f53
 	int		physcoresperchip;	/* Physical cores per chip */
df3f53
 
df3f53
 	int		is_cluster;
df3f53
-	int		nr_socket_on_cluster;
df3f53
 };
df3f53
 
df3f53
 enum {
df3f53
-- 
df3f53
2.29.2
df3f53