Skip to content

Commit db64994

Browse files
aeglbp3tk0v
authored andcommitted
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
1 parent 2e53ad6 commit db64994

3 files changed

Lines changed: 11 additions & 4 deletions

File tree

fs/resctrl/ctrlmondata.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,6 @@ int rdtgroup_mondata_show(struct seq_file *m, void *arg)
677677
{
678678
struct kernfs_open_file *of = m->private;
679679
enum resctrl_res_level resid;
680-
struct rdt_l3_mon_domain *d;
681680
struct rdt_domain_hdr *hdr;
682681
struct rmid_read rr = {0};
683682
struct rdtgroup *rdtgrp;
@@ -705,6 +704,13 @@ int rdtgroup_mondata_show(struct seq_file *m, void *arg)
705704
r = resctrl_arch_get_resource(resid);
706705

707706
if (md->sum) {
707+
struct rdt_l3_mon_domain *d;
708+
709+
if (WARN_ON_ONCE(resid != RDT_RESOURCE_L3)) {
710+
ret = -EINVAL;
711+
goto out;
712+
}
713+
708714
/*
709715
* This file requires summing across all domains that share
710716
* the L3 cache id that was provided in the "domid" field of the

fs/resctrl/internal.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ extern struct mon_evt mon_event_all[QOS_NUM_EVENTS];
9292
* @list: Member of the global @mon_data_kn_priv_list list.
9393
* @rid: Resource id associated with the event file.
9494
* @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.
9797
* @domid: When @sum is zero this is the domain to which
9898
* the event file belongs. When @sum is one this
9999
* is the id of the L3 cache that all domains to be

fs/resctrl/rdtgroup.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3096,7 +3096,8 @@ static void rmdir_all_sub(void)
30963096
* @rid: The resource id for the event file being created.
30973097
* @domid: The domain id for the event file being created.
30983098
* @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.
31003101
*/
31013102
static struct mon_data *mon_get_kn_priv(enum resctrl_res_level rid, int domid,
31023103
struct mon_evt *mevt,

0 commit comments

Comments
 (0)