From: Sandipan Das <sandipan.das@amd.com>
To: <linux-kernel@vger.kernel.org>,
<linux-perf-users@vger.kernel.org>, <x86@kernel.org>
Cc: <peterz@infradead.org>, <mingo@redhat.com>, <acme@kernel.org>,
<mark.rutland@arm.com>, <alexander.shishkin@linux.intel.com>,
<jolsa@kernel.org>, <namhyung@kernel.org>, <irogers@google.com>,
<adrian.hunter@intel.com>, <tglx@linutronix.de>, <bp@alien8.de>,
<dave.hansen@linux.intel.com>, <hpa@zytor.com>,
<eranian@google.com>, <ananth.narayan@amd.com>,
<ravi.bangoria@amd.com>, <santosh.shukla@amd.com>,
<sandipan.das@amd.com>
Subject: [PATCH 0/6] perf/x86/amd: Add memory controller events
Date: Wed, 19 Jul 2023 12:25:35 +0530 [thread overview]
Message-ID: <cover.1689748843.git.sandipan.das@amd.com> (raw)
Unified Memory Controller (UMC) events were introduced with Zen 4 as a
part of the Performance Monitoring Version 2 (PerfMonV2) enhancements.
Currently, Zen 4 supports upto 12 channels of DDR5 memory and each of
them are controlled by a dedicated UMC. Each UMC, in turn, has its own
set of performance monitoring counters. These counters can provide info
on UMC command activity which in turn can be used to derive utilization
and bandwidth. Using perf tool, users can profile activity either on a
combined basis (includes all active UMCs) or for individual UMCs.
E.g. measurement across all UMCs
$ sudo perf stat -e amd_umc/umc_cas_cmd.all/ -a -- sleep 1
Performance counter stats for 'system wide':
544,810 amd_umc/umc_cas_cmd.all/
1.002012663 seconds time elapsed
E.g. measurement specific to certain UMCs
$ sudo perf stat -e amd_umc_0/umc_cas_cmd.all/ -e amd_umc_6/umc_cas_cmd.all/ -a -- sleep 1
Performance counter stats for 'system wide':
21,096 amd_umc_0/umc_cas_cmd.all/
35,428 amd_umc_6/umc_cas_cmd.all/
1.001802611 seconds time elapsed
The available UMCs can be found from sysfs and the socket to which they
belong can be derived from the cpumask.
E.g.
$ find /sys/devices/ -maxdepth 1 -name "amd_umc_*"
/sys/devices/amd_umc_9
/sys/devices/amd_umc_7
/sys/devices/amd_umc_5
/sys/devices/amd_umc_3
/sys/devices/amd_umc_1
/sys/devices/amd_umc_10
/sys/devices/amd_umc_8
/sys/devices/amd_umc_6
/sys/devices/amd_umc_4
/sys/devices/amd_umc_2
/sys/devices/amd_umc_11
/sys/devices/amd_umc_0
$ cat /sys/devices/amd_umc_0/cpumask
0
$ cat /sys/devices/amd_umc_6/cpumask
96
All of the output above comes from a dual socket Genoa system having
96 cores and 6 populated memory channels per socket.
Sandipan Das (6):
perf/x86/amd/uncore: Refactor uncore management
perf/x86/amd/uncore: Use rdmsr if rdpmc is unavailable
x86/cpuid: Add smp helper
perf/x86/amd/uncore: Add group exclusivity
perf/x86/amd/uncore: Add memory controller support
perf vendor events amd: Add Zen 4 memory controller events
arch/x86/events/amd/uncore.c | 893 +++++++++++-------
arch/x86/include/asm/cpuid.h | 14 +
arch/x86/include/asm/msr-index.h | 4 +
arch/x86/include/asm/perf_event.h | 9 +
arch/x86/lib/Makefile | 2 +-
arch/x86/lib/cpuid-smp.c | 36 +
.../arch/x86/amdzen4/memory-controller.json | 101 ++
.../arch/x86/amdzen4/recommended.json | 84 ++
tools/perf/pmu-events/jevents.py | 2 +
9 files changed, 807 insertions(+), 338 deletions(-)
create mode 100644 arch/x86/lib/cpuid-smp.c
create mode 100644 tools/perf/pmu-events/arch/x86/amdzen4/memory-controller.json
--
2.34.1
next reply other threads:[~2023-07-19 6:56 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-19 6:55 Sandipan Das [this message]
2023-07-19 6:55 ` [PATCH 1/6] perf/x86/amd/uncore: Refactor uncore management Sandipan Das
2023-07-19 6:55 ` [PATCH 2/6] perf/x86/amd/uncore: Use rdmsr if rdpmc is unavailable Sandipan Das
2023-07-19 6:55 ` [PATCH 3/6] x86/cpuid: Add smp helper Sandipan Das
2023-07-19 7:28 ` Peter Zijlstra
2023-07-19 7:37 ` Sandipan Das
2023-07-19 7:29 ` Thomas Gleixner
2023-07-19 7:35 ` Sandipan Das
2023-07-19 11:50 ` Thomas Gleixner
2023-07-19 11:59 ` Sandipan Das
2023-07-19 6:55 ` [PATCH 4/6] perf/x86/amd/uncore: Add group exclusivity Sandipan Das
2023-07-19 6:55 ` [PATCH 5/6] perf/x86/amd/uncore: Add memory controller support Sandipan Das
2023-07-19 6:55 ` [PATCH 6/6] perf vendor events amd: Add Zen 4 memory controller events Sandipan Das
2023-07-19 16:12 ` Ian Rogers
2023-07-20 5:23 ` Sandipan Das
2023-07-20 15:50 ` Ian Rogers
2023-07-21 5:15 ` Sandipan Das
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=cover.1689748843.git.sandipan.das@amd.com \
--to=sandipan.das@amd.com \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=ananth.narayan@amd.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=eranian@google.com \
--cc=hpa@zytor.com \
--cc=irogers@google.com \
--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=ravi.bangoria@amd.com \
--cc=santosh.shukla@amd.com \
--cc=tglx@linutronix.de \
--cc=x86@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).