From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 19F3F341063 for ; Mon, 5 Jan 2026 17:58:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.176.79.56 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767635931; cv=none; b=NPK4MBkg67S9iPRXw5G7vj4R9XWzAM7JqwFYEvRJzQ3Gx2cDtEtAHGJqGaTBaa5k3HKneCUMSbPzHKFx/m2uU/2fXEuj8DUSm9xmPBAFdtnscDn0jGNkidk9T3FKxayC1KN2IdEqYKWzZGe2ZBI+j1WnWA0/YRwJRSC6wtXZMVY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767635931; c=relaxed/simple; bh=GhVl4rY2gw5cR0eRzo0mkpNmSCWKZ59bnI882mOLjPo=; h=Date:From:To:CC:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Nii2cMdgfLa0GQqF8aWAaYZQ8ovxIL/cpxYXVfGAYu3Odfegt3Rvn11MrbRnYWEJMou49ObGIMF7HtQ8ZNZX4YuczqsQ4U856OBY4h2zStw3tC5WzGpFzGO8XhaJI+cHVdhZ/k+XS3/OAf5frPmyT8QZjz2t3CdmKecBdv3Cc7E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=185.176.79.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.18.224.83]) by frasgout.his.huawei.com (SkyGuard) with ESMTPS id 4dlMVZ1DBwzJ468h; Tue, 6 Jan 2026 01:58:46 +0800 (CST) Received: from dubpeml100005.china.huawei.com (unknown [7.214.146.113]) by mail.maildlp.com (Postfix) with ESMTPS id 7193240086; Tue, 6 Jan 2026 01:58:46 +0800 (CST) Received: from localhost (10.126.174.38) by dubpeml100005.china.huawei.com (7.214.146.113) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.36; Mon, 5 Jan 2026 17:58:44 +0000 Date: Mon, 5 Jan 2026 17:58:43 +0000 From: Jonathan Cameron To: Ben Horgan CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: Re: [PATCH v2 20/45] arm_mpam: resctrl: Implement helpers to update configuration Message-ID: <20260105175843.00007e35@huawei.com> In-Reply-To: <20251219181147.3404071-21-ben.horgan@arm.com> References: <20251219181147.3404071-1-ben.horgan@arm.com> <20251219181147.3404071-21-ben.horgan@arm.com> X-Mailer: Claws Mail 4.3.0 (GTK 3.24.42; x86_64-w64-mingw32) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: lhrpeml500012.china.huawei.com (7.191.174.4) To dubpeml100005.china.huawei.com (7.214.146.113) On Fri, 19 Dec 2025 18:11:22 +0000 Ben Horgan wrote: > From: James Morse > > 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 > Signed-off-by: Ben Horgan One trivial thing inline. Reviewed-by: Jonathan Cameron > --- > 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. > + */