Re: [PATCH v8 09/32] x86,fs/resctrl: Use struct rdt_domain_hdr instead of struct rdt_mon_domain
From: Reinette Chatre
Date: Thu Aug 14 2025 - 00:07:09 EST
Hi Tony,
On 8/11/25 11:16 AM, Tony Luck wrote:
> All monitoring events are associated with the L3 resource and it made
> sense to use the L3 specific "struct rdt_mon_domain *" arguments to
> functions manipulating domains.
>
> But the addition of monitor events tied to other resources changes
> this assumption.
What assumption?
How about:
"Telemetry events will be tied to another resource. This requires the
functions that manipulate domains to not be L3 specific."
>
> Change the calling sequence to use the generic struct rdt_domain_hdr for
> domain addition and deletion to preserve as much common code as possible.
> This will simplify enabling of enumeration of domains for events in
> other resources.
>
> Make the same change to allow reading events in other resources. In
> this case the code flow passes from mon_event_read() via smp_call*()
> eventually to __mon_event_count() so the rmid_read::d field is replaced
"so the rmid_read::d field is replaced" -> "so replace the L3 specific domain
pointer rmid_read::d with rmid_read::hdr that points to the generic domain
header"
(switch to imperative and remove unnecessary "field" term)
> with the new rmid_read::hdr field.
>
> The mon_data structure is unchanged, but documentation is updated
> to note that mon_data::sum is only used for RDT_RESOURCE_L3.
wait ... this looks familiar ... (looks at v7 feedback) ... same feedback
here as in v7 :(
>
> Signed-off-by: Tony Luck <tony.luck@xxxxxxxxx>
> ---
...
> diff --git a/arch/x86/kernel/cpu/resctrl/core.c b/arch/x86/kernel/cpu/resctrl/core.c
> index 911100994fcd..7fd6cd7348fb 100644
> --- a/arch/x86/kernel/cpu/resctrl/core.c
> +++ b/arch/x86/kernel/cpu/resctrl/core.c
> @@ -529,7 +529,7 @@ static void l3_mon_domain_setup(int cpu, int id, struct rdt_resource *r, struct
>
> list_add_tail_rcu(&d->hdr.list, add_pos);
>
> - err = resctrl_online_mon_domain(r, d);
> + err = resctrl_online_mon_domain(r, &d->hdr);
> if (err) {
> list_del_rcu(&d->hdr.list);
> synchronize_rcu();
> @@ -611,7 +611,7 @@ static void domain_remove_cpu_ctrl(int cpu, struct rdt_resource *r)
> hw_dom = resctrl_to_arch_ctrl_dom(d);
>
> resctrl_offline_ctrl_domain(r, d);
> - list_del_rcu(&d->hdr.list);
> + list_del_rcu(&hdr->list);
> synchronize_rcu();
>
Looks like the change intended for patch #8 landed here instead.
> /*
Reinette