[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251218114726.0000651e@huawei.com>
Date: Thu, 18 Dec 2025 11:47:26 +0000
From: Jonathan Cameron <jonathan.cameron@...wei.com>
To: James Morse <james.morse@....com>
CC: <linux-kernel@...r.kernel.org>, <linux-arm-kernel@...ts.infradead.org>, D
Scott Phillips OS <scott@...amperecomputing.com>,
<carl@...amperecomputing.com>, <lcherian@...vell.com>,
<bobo.shaobowang@...wei.com>, <tan.shaopeng@...itsu.com>,
<baolin.wang@...ux.alibaba.com>, Jamie Iles <quic_jiles@...cinc.com>, "Xin
Hao" <xhao@...ux.alibaba.com>, <peternewman@...gle.com>,
<dfustini@...libre.com>, <amitsinght@...vell.com>, David Hildenbrand
<david@...nel.org>, Dave Martin <dave.martin@....com>, Koba Ko
<kobak@...dia.com>, Shanker Donthineni <sdonthineni@...dia.com>,
<fenghuay@...dia.com>, <baisheng.gao@...soc.com>, Gavin Shan
<gshan@...hat.com>, Ben Horgan <ben.horgan@....com>, <rohit.mathew@....com>,
<reinette.chatre@...el.com>, Punit Agrawal <punit.agrawal@....qualcomm.com>
Subject: Re: [RFC PATCH 11/38] arm_mpam: resctrl: Implement helpers to
update configuration
On Fri, 5 Dec 2025 21:58:34 +0000
James Morse <james.morse@....com> wrote:
> 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.
>
> Imlpement resctrl_arch_update_domains() to use
Implement
> 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>
> ---
> drivers/resctrl/mpam_resctrl.c | 71 ++++++++++++++++++++++++++++++++++
> 1 file changed, 71 insertions(+)
>
> diff --git a/drivers/resctrl/mpam_resctrl.c b/drivers/resctrl/mpam_resctrl.c
> index a26eb1f3efd0..ae0d17857b78 100644
> --- a/drivers/resctrl/mpam_resctrl.c
> +++ b/drivers/resctrl/mpam_resctrl.c
> +int resctrl_arch_update_domains(struct rdt_resource *r, u32 closid)
> +{
> + int err = 0;
> + enum resctrl_conf_type t;
> + struct rdt_ctrl_domain *d;
> + struct resctrl_staged_config *cfg;
> +
> + lockdep_assert_cpus_held();
> + lockdep_assert_irqs_enabled();
> +
> + list_for_each_entry(d, &r->ctrl_domains, hdr.list) {
> + for (t = 0; t < CDP_NUM_TYPES; t++) {
> + cfg = &d->staged_config[t];
> + if (!cfg->have_new_ctrl)
> + continue;
> +
> + err = resctrl_arch_update_one(r, d, closid, t,
> + cfg->new_ctrl);
> + if (err)
> + return err;
> + }
> + }
> +
> + return err;
If it stays this simple in later patches
return 0;
to make it clear this is the good path. Also can then avoid initializing
err at the top.
> +}
> +
> void resctrl_arch_reset_all_ctrls(struct rdt_resource *r)
> {
> struct mpam_resctrl_res *res;
Powered by blists - more mailing lists