[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <270dd0e65f746e97669d9c3b89dfc56e5523e026.1550545163.git.len.brown@intel.com>
Date: Mon, 18 Feb 2019 22:40:08 -0500
From: Len Brown <lenb@...nel.org>
To: x86@...nel.org
Cc: linux-kernel@...r.kernel.org, Len Brown <len.brown@...el.com>
Subject: [PATCH 06/11] x86 topology: define topology_unique_die_id()
From: Len Brown <len.brown@...el.com>
The topology_unique_die_id() helper calculates a unique system-wide die-id,
for the benefit of multi-die per-package systems.
This simple system-wide unique number within known bounds is sufficient.
No need for the overhead of generating a global consecutive "logical" id.
Signed-off-by: Len Brown <len.brown@...el.com>
---
arch/x86/include/asm/topology.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/x86/include/asm/topology.h b/arch/x86/include/asm/topology.h
index a52a572147ba..12444a1a30f3 100644
--- a/arch/x86/include/asm/topology.h
+++ b/arch/x86/include/asm/topology.h
@@ -106,6 +106,9 @@ extern const struct cpumask *cpu_coregroup_mask(int cpu);
#define topology_logical_package_id(cpu) (cpu_data(cpu).logical_proc_id)
#define topology_physical_package_id(cpu) (cpu_data(cpu).phys_proc_id)
+#define topology_unique_die_id(cpu) ((cpu_data(cpu).logical_proc_id * \
+ cpu_data(cpu).x86_max_dies) + \
+ cpu_data(cpu).cpu_die_id)
#define topology_die_id(cpu) (cpu_data(cpu).cpu_die_id)
#define topology_core_id(cpu) (cpu_data(cpu).cpu_core_id)
--
2.18.0-rc0
Powered by blists - more mailing lists