Re: [PATCH v13 05/32] x86,fs/resctrl: Refactor domain create/remove using struct rdt_domain_hdr
From: Reinette Chatre
Date: Wed Nov 12 2025 - 14:19:11 EST
Hi Tony,
On 10/29/25 9:20 AM, Tony Luck wrote:
> diff --git a/fs/resctrl/rdtgroup.c b/fs/resctrl/rdtgroup.c
> index 0320360cd7a6..f5a65c48bcab 100644
> --- a/fs/resctrl/rdtgroup.c
> +++ b/fs/resctrl/rdtgroup.c
> @@ -3164,13 +3164,18 @@ static void mon_rmdir_one_subdir(struct kernfs_node *pkn, char *name, char *subn
> * when last domain being summed is removed.
> */
> static void rmdir_mondata_subdir_allrdtgrp(struct rdt_resource *r,
> - struct rdt_mon_domain *d)
> + struct rdt_domain_hdr *hdr)
> {
> struct rdtgroup *prgrp, *crgrp;
> + struct rdt_mon_domain *d;
> char subname[32];
> bool snc_mode;
> char name[32];
>
> + if (!domain_header_is_valid(hdr, RESCTRL_MON_DOMAIN, RDT_RESOURCE_L3))
> + return;
> +
> + d = container_of(hdr, struct rdt_mon_domain, hdr);
> snc_mode = r->mon_scope == RESCTRL_L3_NODE;
> sprintf(name, "mon_%s_%02d", r->name, snc_mode ? d->ci_id : d->hdr.id);
Please note that this patch is inconsistent in how the functions are modified to access
members of struct rdt_domain_hdr now that it is provided as a parameter. For example, the
above d->hdr.id is unchanged while a similar line in mkdir_mondata_subdir() changes the
d->hdr.id to hdr->id.
This becomes irrelevant when considering the refactoring that comes later in the series but
a reviewer cannot be expected to know that at this point.
Reinette