From: Chun-Tse Shao <ctshao@google.com>
To: Arnaldo Carvalho de Melo <acme@kernel.org>,
Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Mark Rutland <mark.rutland@arm.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Jiri Olsa <jolsa@kernel.org>, Ian Rogers <irogers@google.com>,
Adrian Hunter <adrian.hunter@intel.com>,
James Clark <james.clark@linaro.org>,
Zide Chen <zide.chen@intel.com>,
linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org,
Chun-Tse Shao <ctshao@google.com>
Subject: [PATCH RESEND v7 2/2] perf pmu intel: Adjust cpumasks for sub-NUMA clusters on Sapphire Rapids and Emerald Rapids
Date: Wed, 27 May 2026 15:19:34 -0700 [thread overview]
Message-ID: <20260527221934.3830896-2-ctshao@google.com> (raw)
In-Reply-To: <20260527221934.3830896-1-ctshao@google.com>
Similar to GNR [1], Sapphire Rapids and Emerald Rapids support sub-NUMA
clusters as well. Adjust cpumasks using the same logic as GNR in [1].
Tested on Emerald Rapids with SNC2 enabled:
$ perf stat --per-node -e 'UNC_CHA_CLOCKTICKS,UNC_M_CLOCKTICKS' -a -- sleep 1
Performance counter stats for 'system wide':
N0 30 72125876670 UNC_CHA_CLOCKTICKS
N0 4 8815163648 UNC_M_CLOCKTICKS
N1 30 72124958844 UNC_CHA_CLOCKTICKS
N1 4 8815014974 UNC_M_CLOCKTICKS
N2 30 72121049022 UNC_CHA_CLOCKTICKS
N2 4 8814592626 UNC_M_CLOCKTICKS
N3 30 72117133854 UNC_CHA_CLOCKTICKS
N3 4 8814012840 UNC_M_CLOCKTICKS
1.001574118 seconds time elapsed
[1] lore.kernel.org/20250515181417.491401-1-irogers@google.com
Reviewed-by: Zide Chen <zide.chen@intel.com>
Reviewed-by: Ian Rogers <irogers@google.com>
Signed-off-by: Chun-Tse Shao <ctshao@google.com>
Assisted-by: Gemini:gemini-3.1-pro-preview
---
tools/perf/arch/x86/util/pmu.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/tools/perf/arch/x86/util/pmu.c b/tools/perf/arch/x86/util/pmu.c
index 9b00d5720fb7..2c24ef3140da 100644
--- a/tools/perf/arch/x86/util/pmu.c
+++ b/tools/perf/arch/x86/util/pmu.c
@@ -23,6 +23,8 @@
#include "util/env.h"
#include "util/header.h"
+#define GENUINE_INTEL_SPR "GenuineIntel-6-8F"
+#define GENUINE_INTEL_EMR "GenuineIntel-6-CF"
#define GENUINE_INTEL_GNR "GenuineIntel-6-A[DE]"
static bool cached_snc_supported;
@@ -30,8 +32,10 @@ static pthread_once_t snc_support_once = PTHREAD_ONCE_INIT;
static void init_snc_support(void)
{
- /* Graniterapids supports SNC configuration. */
+ /* Sapphirerapids Emeraldrapids Graniterapids support SNC configuration. */
static const char *const supported_cpuids[] = {
+ GENUINE_INTEL_SPR, /* Sapphirerapids */
+ GENUINE_INTEL_EMR, /* Emeraldrapids */
GENUINE_INTEL_GNR, /* Graniterapids */
};
char *cpuid = get_cpuid_str((struct perf_cpu){0});
@@ -161,6 +165,7 @@ static void init_snc_map(void)
{
int snc_nodes = snc_nodes_per_l3_cache();
char *cpuid;
+ static const u8 spr_emr_snc2_map[] = { 0, 0, 1, 1 };
static const u8 gnr_snc2_map[] = { 1, 1, 0, 0 };
static const u8 snc3_map[] = { 1, 1, 0, 0, 2, 2 };
@@ -168,7 +173,11 @@ static void init_snc_map(void)
case 2:
cpuid = get_cpuid_str((struct perf_cpu){ 0 });
if (cpuid) {
- if (strcmp_cpuid_str(GENUINE_INTEL_GNR, cpuid) == 0) {
+ if (strcmp_cpuid_str(GENUINE_INTEL_SPR, cpuid) == 0 ||
+ strcmp_cpuid_str(GENUINE_INTEL_EMR, cpuid) == 0) {
+ cached_imc_snc_map = spr_emr_snc2_map;
+ cached_imc_snc_map_len = ARRAY_SIZE(spr_emr_snc2_map);
+ } else if (strcmp_cpuid_str(GENUINE_INTEL_GNR, cpuid) == 0) {
cached_imc_snc_map = gnr_snc2_map;
cached_imc_snc_map_len = ARRAY_SIZE(gnr_snc2_map);
}
--
2.54.0.823.g6e5bcc1fc9-goog
next prev parent reply other threads:[~2026-05-27 22:19 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-27 22:19 [PATCH RESEND v7 1/2] perf pmu intel: Generalize SNC cpumask adjustment for multiple platforms Chun-Tse Shao
2026-05-27 22:19 ` Chun-Tse Shao [this message]
2026-05-28 0:11 ` sashiko-bot
2026-05-28 21:31 ` Chun-Tse Shao
2026-06-09 18:44 ` Chun-Tse Shao
2026-08-28 5:28 ` Ian Rogers
2026-08-28 8:11 ` Mi, Dapeng
2026-08-28 16:56 ` Chun-Tse Shao
2026-08-28 17:13 ` Namhyung Kim
2026-08-28 22:50 ` Arnaldo Carvalho de Melo
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=20260527221934.3830896-2-ctshao@google.com \
--to=ctshao@google.com \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=irogers@google.com \
--cc=james.clark@linaro.org \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=zide.chen@intel.com \
/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.