lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a28f8808-5e0e-4998-82d6-1da0db2b571d@intel.com>
Date: Fri, 3 Oct 2025 08:29:36 -0700
From: Reinette Chatre <reinette.chatre@...el.com>
To: Tony Luck <tony.luck@...el.com>, Fenghua Yu <fenghuay@...dia.com>, "Maciej
 Wieczor-Retman" <maciej.wieczor-retman@...el.com>, Peter Newman
	<peternewman@...gle.com>, James Morse <james.morse@....com>, Babu Moger
	<babu.moger@....com>, Drew Fustini <dfustini@...libre.com>, Dave Martin
	<Dave.Martin@....com>, Chen Yu <yu.c.chen@...el.com>
CC: <x86@...nel.org>, <linux-kernel@...r.kernel.org>,
	<patches@...ts.linux.dev>
Subject: Re: [PATCH v11 03/31] x86,fs/resctrl: Refactor
 domain_remove_cpu_mon() ready for new domain types

Hi Tony,

Note that subject prefix indicates resctrl fs code is changed in this patch
but it only changes arch code.

On 9/25/25 1:02 PM, Tony Luck wrote:
> New telemetry events will be associated with a new package scoped
> resource with new domain structures.
> 
> Refactor domain_remove_cpu_mon() so all the L3 processing is separate

"L3 processing" -> "L3 domain processing" ?

> from general actions of clearing the CPU bit in the mask.

"general actions" -> "general domain actions" ?

> 
> Signed-off-by: Tony Luck <tony.luck@...el.com>
> ---
>  arch/x86/kernel/cpu/resctrl/core.c | 21 +++++++++++++--------
>  1 file changed, 13 insertions(+), 8 deletions(-)
> 
> diff --git a/arch/x86/kernel/cpu/resctrl/core.c b/arch/x86/kernel/cpu/resctrl/core.c
> index d422ae3b7ed6..b471918bced6 100644
> --- a/arch/x86/kernel/cpu/resctrl/core.c
> +++ b/arch/x86/kernel/cpu/resctrl/core.c
> @@ -645,20 +645,25 @@ static void domain_remove_cpu_mon(int cpu, struct rdt_resource *r)
>  		return;
>  	}
>  
> -	if (!domain_header_is_valid(hdr, RESCTRL_MON_DOMAIN, r->rid))
> +	cpumask_clear_cpu(cpu, &hdr->cpu_mask);
> +	if (!cpumask_empty(&hdr->cpu_mask))
>  		return;
>  
> -	d = container_of(hdr, struct rdt_mon_domain, hdr);
> -	hw_dom = resctrl_to_arch_mon_dom(d);
> +	switch (r->rid) {
> +	case RDT_RESOURCE_L3:

This function evolves to where its local declarations contain a mix of domain structures
of different resources. I think it will make this function easier to understand if the
resource specific structures are declared local to the code block dedicated to that resource.
		case RDT_RESOURCE_L3: {
			struct rdt_hw_mon_domain *hw_dom;
			struct rdt_mon_domain *d;
		
			...

			break;
		}

> +		if (!domain_header_is_valid(hdr, RESCTRL_MON_DOMAIN, RDT_RESOURCE_L3))
> +			return;
>  
> -	cpumask_clear_cpu(cpu, &d->hdr.cpu_mask);
> -	if (cpumask_empty(&d->hdr.cpu_mask)) {
> +		d = container_of(hdr, struct rdt_mon_domain, hdr);
> +		hw_dom = resctrl_to_arch_mon_dom(d);
>  		resctrl_offline_mon_domain(r, d);
> -		list_del_rcu(&d->hdr.list);
> +		list_del_rcu(&hdr->list);
>  		synchronize_rcu();
>  		mon_domain_free(hw_dom);
> -
> -		return;
> +		break;
> +	default:
> +		pr_warn_once("Unknown resource rid=%d\n", r->rid);
> +		break;
>  	}
>  }
>  

Reinette


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ