[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260105175843.00007e35@huawei.com>
Date: Mon, 5 Jan 2026 17:58:43 +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 20/45] arm_mpam: resctrl: Implement helpers to update
configuration
On Fri, 19 Dec 2025 18:11:22 +0000
Ben Horgan <ben.horgan@....com> wrote:
> From: James Morse <james.morse@....com>
>
> resctrl has two helpers for updating the configuration.
> resctrl_arch_update_one() updates a single value, and is used by the
> software-controller to apply feedback to the bandwidth controls, it has to
> be called on one of the CPUs in the resctrl:domain.
>
> resctrl_arch_update_domains() copies multiple staged configurations, it can
> be called from anywhere.
>
> Both helpers should update any changes to the underlying hardware.
>
> Implement resctrl_arch_update_domains() to use
> resctrl_arch_update_one(). Neither need to be called on a specific CPU as
> the mpam driver will send IPIs as needed.
>
> Signed-off-by: James Morse <james.morse@....com>
> Signed-off-by: Ben Horgan <ben.horgan@....com>
One trivial thing inline.
Reviewed-by: Jonathan Cameron <jonathan.cameron@...wei.com>
> ---
> list_for_each_entry -> list_for_each_entry_rcu
> return 0
> Restrict scope of local variables
> ---
> drivers/resctrl/mpam_resctrl.c | 70 ++++++++++++++++++++++++++++++++++
> 1 file changed, 70 insertions(+)
>
> diff --git a/drivers/resctrl/mpam_resctrl.c b/drivers/resctrl/mpam_resctrl.c
> index 607e5f41f9e7..e5ec5438eca8 100644
> --- a/drivers/resctrl/mpam_resctrl.c
> +++ b/drivers/resctrl/mpam_resctrl.c
> @@ -210,6 +210,76 @@ u32 resctrl_arch_get_config(struct rdt_resource *r, struct rdt_ctrl_domain *d,
> }
> }
>
> +int resctrl_arch_update_one(struct rdt_resource *r, struct rdt_ctrl_domain *d,
> + u32 closid, enum resctrl_conf_type t, u32 cfg_val)
> +{
...
> + partid = resctrl_get_config_index(closid, t);
> + if (!r->alloc_capable || partid >= resctrl_arch_get_num_closid(r)) {
> + pr_debug("Not alloc capable or computed PARTID out of range\n");
> + return -EINVAL;
> + }
> +
> + /*
Spaces instead of a tab.
> + * Copy the current config to avoid clearing other resources when the
> + * same component is exposed multiple times through resctrl.
> + */
Powered by blists - more mailing lists