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: <20260105174233.00004df8@huawei.com>
Date: Mon, 5 Jan 2026 17:42:33 +0000
From: Jonathan Cameron <jonathan.cameron@...wei.com>
To: Ben Horgan <ben.horgan@....com>
CC: <amitsinght@...vell.com>, <baisheng.gao@...soc.com>,
	<baolin.wang@...ux.alibaba.com>, <carl@...amperecomputing.com>,
	<dave.martin@....com>, <david@...nel.org>, <dfustini@...libre.com>,
	<fenghuay@...dia.com>, <gshan@...hat.com>, <james.morse@....com>,
	<kobak@...dia.com>, <lcherian@...vell.com>,
	<linux-arm-kernel@...ts.infradead.org>, <linux-kernel@...r.kernel.org>,
	<peternewman@...gle.com>, <punit.agrawal@....qualcomm.com>,
	<quic_jiles@...cinc.com>, <reinette.chatre@...el.com>,
	<rohit.mathew@....com>, <scott@...amperecomputing.com>,
	<sdonthineni@...dia.com>, <tan.shaopeng@...itsu.com>,
	<xhao@...ux.alibaba.com>, <catalin.marinas@....com>, <will@...nel.org>,
	<corbet@....net>, <maz@...nel.org>, <oupton@...nel.org>,
	<joey.gouly@....com>, <suzuki.poulose@....com>, <kvmarm@...ts.linux.dev>
Subject: Re: [PATCH v2 16/45] arm_mpam: resctrl: Sort the order of the
 domain lists

On Fri, 19 Dec 2025 18:11:18 +0000
Ben Horgan <ben.horgan@....com> wrote:

> From: James Morse <james.morse@....com>
> 
> resctrl documents that the domains appear in numeric order in the schemata
> file. This means a little more work is needed when bringing a domain
> online.
> 
> Add the support for this, using resctrl_find_domain() to find the point to
> insert in the list.
> 
> Signed-off-by: James Morse <james.morse@....com>
> Signed-off-by: Ben Horgan <ben.horgan@....com>
I guess this was split out to try and make previous patch easier to read.
I'm not sure I'd bother in this particular case as those TODOs were
ugly, but anyhow LGTM

Reviewed-by: Jonathan Cameron <jonathan.cameron@...wei.com>

> ---
>  drivers/resctrl/mpam_resctrl.c | 21 +++++++++++++++++----
>  1 file changed, 17 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/resctrl/mpam_resctrl.c b/drivers/resctrl/mpam_resctrl.c
> index 4beeeded00ff..5481d9cc69d9 100644
> --- a/drivers/resctrl/mpam_resctrl.c
> +++ b/drivers/resctrl/mpam_resctrl.c
> @@ -117,6 +117,21 @@ static bool mpam_resctrl_offline_domain_hdr(unsigned int cpu,
>  	return false;
>  }
>  
> +static void mpam_resctrl_domain_insert(struct list_head *list,
> +				       struct rdt_domain_hdr *new)
> +{
> +	struct rdt_domain_hdr *err;
> +	struct list_head *pos = NULL;
> +
> +	lockdep_assert_held(&domain_list_lock);
> +
> +	err = resctrl_find_domain(list, new->id, &pos);
> +	if (WARN_ON_ONCE(err))
> +		return;
> +
> +	list_add_tail_rcu(&new->list, pos);
> +}
> +
>  static struct mpam_resctrl_dom *
>  mpam_resctrl_alloc_domain(unsigned int cpu, struct mpam_resctrl_res *res)
>  {
> @@ -154,8 +169,7 @@ mpam_resctrl_alloc_domain(unsigned int cpu, struct mpam_resctrl_res *res)
>  		ctrl_d = &dom->resctrl_ctrl_dom;
>  		mpam_resctrl_domain_hdr_init(cpu, ctrl_comp, &ctrl_d->hdr);
>  		ctrl_d->hdr.type = RESCTRL_CTRL_DOMAIN;
> -		/* TODO: this list should be sorted */
> -		list_add_tail_rcu(&ctrl_d->hdr.list, &r->ctrl_domains);
> +		mpam_resctrl_domain_insert(&r->ctrl_domains, &ctrl_d->hdr);
>  		err = resctrl_online_ctrl_domain(r, ctrl_d);
>  		if (err) {
>  			dom = ERR_PTR(err);
> @@ -169,8 +183,7 @@ mpam_resctrl_alloc_domain(unsigned int cpu, struct mpam_resctrl_res *res)
>  		mon_d = &dom->resctrl_mon_dom;
>  		mpam_resctrl_domain_hdr_init(cpu, ctrl_comp, &mon_d->hdr);
>  		mon_d->hdr.type = RESCTRL_MON_DOMAIN;
> -		/* TODO: this list should be sorted */
> -		list_add_tail_rcu(&mon_d->hdr.list, &r->mon_domains);
> +		mpam_resctrl_domain_insert(&r->mon_domains, &mon_d->hdr);
>  		err = resctrl_online_mon_domain(r, mon_d);
>  		if (err) {
>  			dom = ERR_PTR(err);


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ