Skip to content

Commit dcb4971

Browse files
committed
Merge tag 'x86_cache_for_v7.0_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 resource control updates from Borislav Petkov: - Extend the resctrl machinery to support telemetry monitoring on Intel (Tony Luck) The practical usage of this is being able to tell how much energy or how much work can be attributed to a group of tasks tracked under a single idenitifier. Prepend this work with proper refactoring of resctrl domains handling code. * tag 'x86_cache_for_v7.0_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (30 commits) x86,fs/resctrl: Update documentation for telemetry events x86/resctrl: Enable RDT_RESOURCE_PERF_PKG fs/resctrl: Move RMID initialization to first mount x86,fs/resctrl: Compute number of RMIDs as minimum across resources fs/resctrl: Move allocation/free of closid_num_dirty_rmid[] x86/resctrl: Handle number of RMIDs supported by RDT_RESOURCE_PERF_PKG x86/resctrl: Add energy/perf choices to rdt boot option x86,fs/resctrl: Handle domain creation/deletion for RDT_RESOURCE_PERF_PKG fs/resctrl: Refactor rmdir_mondata_subdir_allrdtgrp() fs/resctrl: Refactor mkdir_mondata_subdir() x86/resctrl: Read telemetry events x86/resctrl: Find and enable usable telemetry events x86,fs/resctrl: Add architectural event pointer x86,fs/resctrl: Fill in details of events for performance and energy GUIDs x86/resctrl: Discover hardware telemetry events fs/resctrl: Emphasize that L3 monitoring resource is required for summing domains x86,fs/resctrl: Add and initialize a resource for package scope monitoring x86,fs/resctrl: Add an architectural hook called for first mount x86,fs/resctrl: Support binary fixed point event counters x86,fs/resctrl: Handle events that can be read from any CPU ...
2 parents 75b2a60 + a8848c4 commit dcb4971

14 files changed

Lines changed: 1295 additions & 399 deletions

File tree

Documentation/admin-guide/kernel-parameters.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6354,9 +6354,14 @@ Kernel parameters
63546354
rdt= [HW,X86,RDT]
63556355
Turn on/off individual RDT features. List is:
63566356
cmt, mbmtotal, mbmlocal, l3cat, l3cdp, l2cat, l2cdp,
6357-
mba, smba, bmec, abmc, sdciae.
6357+
mba, smba, bmec, abmc, sdciae, energy[:guid],
6358+
perf[:guid].
63586359
E.g. to turn on cmt and turn off mba use:
63596360
rdt=cmt,!mba
6361+
To turn off all energy telemetry monitoring and ensure that
6362+
perf telemetry monitoring associated with guid 0x12345
6363+
is enabled use:
6364+
rdt=!energy,perf:0x12345
63606365

63616366
reboot= [KNL]
63626367
Format (x86 or x86_64):

Documentation/filesystems/resctrl.rst

Lines changed: 54 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -252,13 +252,12 @@ with respect to allocation:
252252
bandwidth percentages are directly applied to
253253
the threads running on the core
254254

255-
If RDT monitoring is available there will be an "L3_MON" directory
255+
If L3 monitoring is available there will be an "L3_MON" directory
256256
with the following files:
257257

258258
"num_rmids":
259-
The number of RMIDs available. This is the
260-
upper bound for how many "CTRL_MON" + "MON"
261-
groups can be created.
259+
The number of RMIDs supported by hardware for
260+
L3 monitoring events.
262261

263262
"mon_features":
264263
Lists the monitoring events if
@@ -484,6 +483,24 @@ with the following files:
484483
bytes) at which a previously used LLC_occupancy
485484
counter can be considered for reuse.
486485

486+
If telemetry monitoring is available there will be a "PERF_PKG_MON" directory
487+
with the following files:
488+
489+
"num_rmids":
490+
The number of RMIDs for telemetry monitoring events.
491+
492+
On Intel resctrl will not enable telemetry events if the number of
493+
RMIDs that can be tracked concurrently is lower than the total number
494+
of RMIDs supported. Telemetry events can be force-enabled with the
495+
"rdt=" kernel parameter, but this may reduce the number of
496+
monitoring groups that can be created.
497+
498+
"mon_features":
499+
Lists the telemetry monitoring events that are enabled on this system.
500+
501+
The upper bound for how many "CTRL_MON" + "MON" can be created
502+
is the smaller of the L3_MON and PERF_PKG_MON "num_rmids" values.
503+
487504
Finally, in the top level of the "info" directory there is a file
488505
named "last_cmd_status". This is reset with every "command" issued
489506
via the file system (making new directories or writing to any of the
@@ -589,15 +606,40 @@ When control is enabled all CTRL_MON groups will also contain:
589606
When monitoring is enabled all MON groups will also contain:
590607

591608
"mon_data":
592-
This contains a set of files organized by L3 domain and by
593-
RDT event. E.g. on a system with two L3 domains there will
594-
be subdirectories "mon_L3_00" and "mon_L3_01". Each of these
595-
directories have one file per event (e.g. "llc_occupancy",
596-
"mbm_total_bytes", and "mbm_local_bytes"). In a MON group these
597-
files provide a read out of the current value of the event for
598-
all tasks in the group. In CTRL_MON groups these files provide
599-
the sum for all tasks in the CTRL_MON group and all tasks in
609+
This contains directories for each monitor domain.
610+
611+
If L3 monitoring is enabled, there will be a "mon_L3_XX" directory for
612+
each instance of an L3 cache. Each directory contains files for the enabled
613+
L3 events (e.g. "llc_occupancy", "mbm_total_bytes", and "mbm_local_bytes").
614+
615+
If telemetry monitoring is enabled, there will be a "mon_PERF_PKG_YY"
616+
directory for each physical processor package. Each directory contains
617+
files for the enabled telemetry events (e.g. "core_energy". "activity",
618+
"uops_retired", etc.)
619+
620+
The info/`*`/mon_features files provide the full list of enabled
621+
event/file names.
622+
623+
"core energy" reports a floating point number for the energy (in Joules)
624+
consumed by cores (registers, arithmetic units, TLB and L1/L2 caches)
625+
during execution of instructions summed across all logical CPUs on a
626+
package for the current monitoring group.
627+
628+
"activity" also reports a floating point value (in Farads). This provides
629+
an estimate of work done independent of the frequency that the CPUs used
630+
for execution.
631+
632+
Note that "core energy" and "activity" only measure energy/activity in the
633+
"core" of the CPU (arithmetic units, TLB, L1 and L2 caches, etc.). They
634+
do not include L3 cache, memory, I/O devices etc.
635+
636+
All other events report decimal integer values.
637+
638+
In a MON group these files provide a read out of the current value of
639+
the event for all tasks in the group. In CTRL_MON groups these files
640+
provide the sum for all tasks in the CTRL_MON group and all tasks in
600641
MON groups. Please see example section for more details on usage.
642+
601643
On systems with Sub-NUMA Cluster (SNC) enabled there are extra
602644
directories for each node (located within the "mon_L3_XX" directory
603645
for the L3 cache they occupy). These are named "mon_sub_L3_YY"

arch/x86/Kconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,19 @@ config X86_CPU_RESCTRL
541541

542542
Say N if unsure.
543543

544+
config X86_CPU_RESCTRL_INTEL_AET
545+
bool "Intel Application Energy Telemetry"
546+
depends on X86_64 && X86_CPU_RESCTRL && CPU_SUP_INTEL && INTEL_PMT_TELEMETRY=y && INTEL_TPMI=y
547+
help
548+
Enable per-RMID telemetry events in resctrl.
549+
550+
Intel feature that collects per-RMID execution data
551+
about energy consumption, measure of frequency independent
552+
activity and other performance metrics. Data is aggregated
553+
per package.
554+
555+
Say N if unsure.
556+
544557
config X86_FRED
545558
bool "Flexible Return and Event Delivery"
546559
depends on X86_64

arch/x86/kernel/cpu/resctrl/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# SPDX-License-Identifier: GPL-2.0
22
obj-$(CONFIG_X86_CPU_RESCTRL) += core.o rdtgroup.o monitor.o
33
obj-$(CONFIG_X86_CPU_RESCTRL) += ctrlmondata.o
4+
obj-$(CONFIG_X86_CPU_RESCTRL_INTEL_AET) += intel_aet.o
45
obj-$(CONFIG_RESCTRL_FS_PSEUDO_LOCK) += pseudo_lock.o
56

67
# To allow define_trace.h's recursive include:

0 commit comments

Comments
 (0)