Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

fs/resctrl: Emphasize that L3 monitoring resource is required for summing domains

The feature to sum event data across multiple domains supports systems with
Sub-NUMA Cluster (SNC) mode enabled. The top-level monitoring files in each
"mon_L3_XX" directory provide the sum of data across all SNC nodes sharing an
L3 cache instance while the "mon_sub_L3_YY" sub-directories provide the event
data of the individual nodes.

SNC is only associated with the L3 resource and domains and as a result the
flow handling the sum of event data implicitly assumes it is working with
the L3 resource and domains.

Reading of telemetry events does not require to sum event data so this feature
can remain dedicated to SNC and keep the implicit assumption of working with
the L3 resource and domains.

Add a WARN to where the implicit assumption of working with the L3 resource
is made and add comments on how the structure controlling the event sum
feature is used.

Suggested-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Reinette Chatre <reinette.chatre@intel.com>
Link: https://lore.kernel.org/20251217172121.12030-1-tony.luck@intel.com

authored by

Tony Luck and committed by
Borislav Petkov (AMD)
db64994d 2e53ad66

+11 -4
+7 -1
fs/resctrl/ctrlmondata.c
··· 677 677 { 678 678 struct kernfs_open_file *of = m->private; 679 679 enum resctrl_res_level resid; 680 - struct rdt_l3_mon_domain *d; 681 680 struct rdt_domain_hdr *hdr; 682 681 struct rmid_read rr = {0}; 683 682 struct rdtgroup *rdtgrp; ··· 704 705 r = resctrl_arch_get_resource(resid); 705 706 706 707 if (md->sum) { 708 + struct rdt_l3_mon_domain *d; 709 + 710 + if (WARN_ON_ONCE(resid != RDT_RESOURCE_L3)) { 711 + ret = -EINVAL; 712 + goto out; 713 + } 714 + 707 715 /* 708 716 * This file requires summing across all domains that share 709 717 * the L3 cache id that was provided in the "domid" field of the
+2 -2
fs/resctrl/internal.h
··· 92 92 * @list: Member of the global @mon_data_kn_priv_list list. 93 93 * @rid: Resource id associated with the event file. 94 94 * @evt: Event structure associated with the event file. 95 - * @sum: Set when event must be summed across multiple 96 - * domains. 95 + * @sum: Set for RDT_RESOURCE_L3 when event must be summed 96 + * across multiple domains. 97 97 * @domid: When @sum is zero this is the domain to which 98 98 * the event file belongs. When @sum is one this 99 99 * is the id of the L3 cache that all domains to be
+2 -1
fs/resctrl/rdtgroup.c
··· 3096 3096 * @rid: The resource id for the event file being created. 3097 3097 * @domid: The domain id for the event file being created. 3098 3098 * @mevt: The type of event file being created. 3099 - * @do_sum: Whether SNC summing monitors are being created. 3099 + * @do_sum: Whether SNC summing monitors are being created. Only set 3100 + * when @rid == RDT_RESOURCE_L3. 3100 3101 */ 3101 3102 static struct mon_data *mon_get_kn_priv(enum resctrl_res_level rid, int domid, 3102 3103 struct mon_evt *mevt,