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: <aEYH38g4N_ZNlv6b@agluck-desk3>
Date: Sun, 8 Jun 2025 14:59:59 -0700
From: "Luck, Tony" <tony.luck@...el.com>
To: Fenghua Yu <fenghuay@...dia.com>
Cc: Reinette Chatre <reinette.chatre@...el.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>,
	Anil Keshavamurthy <anil.s.keshavamurthy@...el.com>,
	Chen Yu <yu.c.chen@...el.com>, x86@...nel.org,
	linux-kernel@...r.kernel.org, patches@...ts.linux.dev
Subject: Re: [PATCH v5 04/29] x86,fs/resctrl: Prepare for more monitor events

On Fri, Jun 06, 2025 at 05:45:58PM -0700, Fenghua Yu wrote:
[SNIP]

> > diff --git a/arch/x86/kernel/cpu/resctrl/core.c b/arch/x86/kernel/cpu/resctrl/core.c
> > index 819bc7a09327..4403a820db12 100644
> > --- a/arch/x86/kernel/cpu/resctrl/core.c
> > +++ b/arch/x86/kernel/cpu/resctrl/core.c
> > @@ -364,8 +364,8 @@ static void ctrl_domain_free(struct rdt_hw_ctrl_domain *hw_dom)
> >   static void mon_domain_free(struct rdt_hw_mon_domain *hw_dom)
> >   {
> > -	kfree(hw_dom->arch_mbm_total);
> > -	kfree(hw_dom->arch_mbm_local);
> > +	for (int i = 0; i < QOS_NUM_L3_MBM_EVENTS; i++)
> > +		kfree(hw_dom->arch_mbm_states[i]);
> 
> Is it better to define a helper for_each_mon_event_idx(i)?
> 
> #define for_each_mbm_event_idx(i) \
> 
>     for (int i = 0; i < QOS_NUM_L3_MBM_EVENTS; i++)
> 
> Then the above for loop can be simplified to:
> 
>     for_each_mbm_event_idxd(i)
> 
> 	kfree(hw_dom->arch_mbm_states[i]);
> 
> The helper can be used in other places as well (see below).

I think there are only two places total. So maybe?

-Tony

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ