Skip to contentSkip to conversation

perf/x86/intel/uncore: Use boot_cpu_data.phys_proc_id instead of hardcorded phy id 0

PATCH RESEND In review Masayoshi Mizuma 4 participants 6 messages Sep 10, 2018 – Oct 2, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 perf/x86/intel/uncore: Use boot_cpu_data.phys_proc_id instead of hardcorded phy id 0

From: Masayoshi Mizuma <[email protected]>

Physical package id 0 is not always exists. We should use boot_cpu_data.phys_proc_id here.

---
 arch/x86/events/intel/uncore_snbep.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/events/intel/uncore_snbep.c +1 -1
index 51d7c11..53b981d 100644
@@ -3061,7 +3061,7 @@ static struct event_constraint bdx_uncore_pcu_constraints[] = {
 
 void bdx_uncore_cpu_init(void)
 {
-	int pkg = topology_phys_to_logical_pkg(0);
+	int pkg = topology_phys_to_logical_pkg(boot_cpu_data.phys_proc_id);
 
 	if (bdx_uncore_cbox.num_boxes > boot_cpu_data.x86_max_cores)
 		bdx_uncore_cbox.num_boxes = boot_cpu_data.x86_max_cores;
Signature · 1 line
2.18.0
#1 lore raw

Ping...

Quoted 26 lines · Masayoshi Mizuma

From: Masayoshi Mizuma <[email protected]>

Physical package id 0 is not always exists. We should use boot_cpu_data.phys_proc_id here.

---
 arch/x86/events/intel/uncore_snbep.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/events/intel/uncore_snbep.c +1 -1
index 51d7c11..53b981d 100644
@@ -3061,7 +3061,7 @@ static struct event_constraint bdx_uncore_pcu_constraints[] = {
 
 void bdx_uncore_cpu_init(void)
 {
-	int pkg = topology_phys_to_logical_pkg(0);
+	int pkg = topology_phys_to_logical_pkg(boot_cpu_data.phys_proc_id);
 
 	if (bdx_uncore_cbox.num_boxes > boot_cpu_data.x86_max_cores)
 		bdx_uncore_cbox.num_boxes = boot_cpu_data.x86_max_cores;
Signature · 1 line
2.18.0
#2 lore raw
In reply to Masayoshi Mizuma

On Mon, 10 Sep 2018, Masayoshi Mizuma wrote:

CC+ Kan

Quoted 15 lines

From: Masayoshi Mizuma <[email protected]>

Physical package id 0 is not always exists. We should use boot_cpu_data.phys_proc_id here.

---
 arch/x86/events/intel/uncore_snbep.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/events/intel/uncore_snbep.c +0 -0
index 51d7c11..53b981d 100644

arch/x86/events/intel/uncore_snbep.c static struct event_constraint bdx_uncore_pcu_constraints[] = { · line 3064

Quoted 5 lines
arch/x86/events/intel/uncore_snbep.c +1 -1
@@ -3061,7 +3061,7 @@ static struct event_constraint bdx_uncore_pcu_constraints[] = {
 
 void bdx_uncore_cpu_init(void)
 {
-	int pkg = topology_phys_to_logical_pkg(0);
+	int pkg = topology_phys_to_logical_pkg(boot_cpu_data.phys_proc_id);

Looks correct.

Quoted 6 lines
arch/x86/events/intel/uncore_snbep.c +0 -0
 	if (bdx_uncore_cbox.num_boxes > boot_cpu_data.x86_max_cores)
 		bdx_uncore_cbox.num_boxes = boot_cpu_data.x86_max_cores;
Signature · 1 line
2.18.0
#3 lore raw
Quoted 20 lines · Thomas Gleixner

On Mon, 10 Sep 2018, Masayoshi Mizuma wrote:

CC+ Kan

Quoted 16 lines

From: Masayoshi Mizuma <[email protected]>

Physical package id 0 is not always exists. We should use boot_cpu_data.phys_proc_id here.

---
  arch/x86/events/intel/uncore_snbep.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/events/intel/uncore_snbep.c +0 -0
index 51d7c11..53b981d 100644
@@ -3061,7 +3061,7 @@ static struct event_constraint bdx_uncore_pcu_constraints[] = {
 
Quoted 4 lines

arch/x86/events/intel/uncore_snbep.c static struct event_constraint bdx_uncore_pcu_constraints[] = { · line 3064

Quoted 4 lines
arch/x86/events/intel/uncore_snbep.c +1 -1
  void bdx_uncore_cpu_init(void)
  {
-	int pkg = topology_phys_to_logical_pkg(0);
+	int pkg = topology_phys_to_logical_pkg(boot_cpu_data.phys_proc_id);

I think it's better to use logical_proc_id directly.

+ int pkg = boot_cpu_data.logical_proc_id;

Thanks,
Kan

#4 lore raw
Quoted 29 lines · Kan
Quoted 14 lines · Thomas Gleixner

On Mon, 10 Sep 2018, Masayoshi Mizuma wrote:

CC+ Kan

Quoted 10 lines

From: Masayoshi Mizuma <[email protected]>

Physical package id 0 is not always exists. We should use boot_cpu_data.phys_proc_id here.

---
  arch/x86/events/intel/uncore_snbep.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 9 lines

arch/x86/events/intel/uncore_snbep.c static struct event_constraint bdx_uncore_pcu_constraints[] = { · line 3063

Quoted 9 lines
arch/x86/events/intel/uncore_snbep.c +1 -1
index 51d7c11..53b981d 100644
@@ -3061,7 +3061,7 @@ static struct event_constraint bdx_uncore_pcu_constraints[] = {
  void bdx_uncore_cpu_init(void)
  {
-	int pkg = topology_phys_to_logical_pkg(0);
+	int pkg = topology_phys_to_logical_pkg(boot_cpu_data.phys_proc_id);

I think it's better to use logical_proc_id directly.

Review

Quoted 1 line
(quoted diff) +1 -0
+	int pkg = boot_cpu_data.logical_proc_id;

Thanks! I'll send the v2.

- Masa

#5 lore raw

[tip:perf/core] perf/x86/intel/uncore: Use boot_cpu_data.phys_proc_id instead of hardcorded physical package ID 0

In reply to Masayoshi Mizuma
perf/x86/intel/uncore: Use boot_cpu_data.phys_proc_id instead of hardcorded physical package ID 0
Commit-ID:  6265adb9726098b7f4f7ca70bc51992b25fdd9d6
Gitweb:     https://git.kernel.org/tip/6265adb9726098b7f4f7ca70bc51992b25fdd9d6
Author:     Masayoshi Mizuma <[email protected]>
AuthorDate: Mon, 10 Sep 2018 10:47:50 -0400
Committer:  Ingo Molnar <[email protected]>
CommitDate: Tue, 2 Oct 2018 09:37:58 +0200

perf/x86/intel/uncore: Use boot_cpu_data.phys_proc_id instead of hardcorded physical package ID 0

Physical package id 0 doesn't always exist, we should use boot_cpu_data.phys_proc_id here.

Cc Alexander Shishkin <[email protected]>
Cc Arnaldo Carvalho de Melo <[email protected]>
Cc H. Peter Anvin <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Linus Torvalds <[email protected]>
Cc Masayoshi Mizuma <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Stephane Eranian <[email protected]>
Cc Thomas Gleixner <[email protected]>
Cc Vince Weaver <[email protected]>
---
 arch/x86/events/intel/uncore_snbep.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/events/intel/uncore_snbep.c +1 -1
index 51d7c117e3c7..53b981dcdb42 100644
@@ -3061,7 +3061,7 @@ static struct event_constraint bdx_uncore_pcu_constraints[] = {
 
 void bdx_uncore_cpu_init(void)
 {
-	int pkg = topology_phys_to_logical_pkg(0);
+	int pkg = topology_phys_to_logical_pkg(boot_cpu_data.phys_proc_id);
 
 	if (bdx_uncore_cbox.num_boxes > boot_cpu_data.x86_max_cores)
 		bdx_uncore_cbox.num_boxes = boot_cpu_data.x86_max_cores;