From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 73308606A31A for ; Fri, 23 Oct 2026 08:09:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=4odQqC5H; dkim=pass (1024-bit key, unprotected) header.d=huawei.com header.i=@huawei.com header.a=rsa-sha256 header.s=dkim header.b=OXYQntCY DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:CC:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Unsubscribe-Post: List-Owner; bh=1RVh2/Dbz81D9r2JCs/p2pOJTWf7dMj+/zj30/kv+Rg=; b=4odQqC5Htni3JH fhoCDyFld13MPCmY923vtpYTvIVEpez69HBQT5DcKlDOxLm40aVD9NTsvidggrFKS9XxIDkwxXKm+ kDL34UVUcNKvNxAzEmxZ33LhZNbZ7ErCe/OifCUTPXOey2+njpvY8FXO3Fs0ROnE56bx5asRIpHc3 XYvKfZ8OGO5TB8qj+xRrBda8f2nU8yNV6LJXdylI60q93g+gZGOrcE1Eb09N6q+pQd+j7pmoEZ4eh ayrEOQ0xCZlepQswxLFNhY6zBrEoCTp+8cWkGx+sC7WFVNc8B1BKXt+1mCGfvaFd9iSoQt0cf57Md jTgzoLL6zjX8DnpS+GBA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xKAKh-0000000FspS-0n4s; Fri, 23 Oct 2026 08:08:59 +0000 Received: from canpmsgout02.his.huawei.com ([113.46.200.217]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xKAKe-0000000Fsog-0ghg for linux-arm-kernel@lists.infradead.org; Fri, 23 Oct 2026 08:08:57 +0000 dkim-signature: v=1; a=rsa-sha256; d=huawei.com; s=dkim; c=relaxed/relaxed; q=dns/txt; h=From; bh=1RVh2/Dbz81D9r2JCs/p2pOJTWf7dMj+/zj30/kv+Rg=; b=OXYQntCY9JSvb+0ZyqwbzKWoNTRqfD1P+SAsk+lz3UDzx+yL1GsN/j2pFCeUYIjmZaMwhJBV+ 2dkR+JpAfJcWMxzM4i/pzVyMBCW2IEukCypSQLhe0Zr2geBNE61Q2hnzHPXmARGEul6k1dQmlcd oyU46dFciaSQpW0bxd1OmtU= Received: from mail.maildlp.com (unknown [172.19.162.223]) by canpmsgout02.his.huawei.com (SkyGuard) with ESMTPS id 4j9wdQ2vPZzcb41; Fri, 23 Oct 2026 16:08:42 +0800 (CST) Received: from kwepemk200008.china.huawei.com (unknown [7.202.194.74]) by mail.maildlp.com (Postfix) with ESMTPS id DD7C840575; Fri, 23 Oct 2026 16:08:46 +0800 (CST) Received: from [10.67.110.68] (10.67.110.68) by kwepemk200008.china.huawei.com (7.202.194.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.45; Fri, 23 Oct 2026 16:08:45 +0800 Message-ID: <63de9d6d-96c9-401e-963e-0e3183ef5fd1@huawei.com> Date: Fri, 23 Oct 2026 16:08:45 +0800 X-Archived-By: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC PATCH v2 02/10] arm_mpam: resctrl: Rename ctrl_comp in mpam_resctrl_alloc_domain() To: Reinette Chatre , , , , CC: , , , , , , References: From: Jinjie Ruan In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-ClientProxiedBy: kwepems500001.china.huawei.com (7.221.188.70) To kwepemk200008.china.huawei.com (7.202.194.74) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261023_010856_524610_B6A7D1C6 X-CRM114-Status: GOOD ( 21.62 ) X-Spam-Score: -2.1 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" X-Spam-Status: No, score=-17.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 在 2026/10/20 6:07, Reinette Chatre 写道: > mpam_resctrl_alloc_domain() looks up the component of the resource's > class that contains the CPU and fails the domain allocation if there is > none. The component is held in a local variable named ctrl_comp and, when > the resource supports allocation, it also backs the control domain. > > The lookup and its check apply to every resource, including one that > supports only monitoring. For such a resource the component does not > back a control domain, so the name ctrl_comp is misleading. The name also > makes a comment in the same function ambiguous. The comment notes that > there may be no ctrl_comp for the L3, which is true of the control > domain's component but contradicts the local variable, which always > refers to a component once the lookup succeeds. > > Rename the local variable to comp. Keep the ctrl_comp name for the > control domain's reference to its component because it only ever refers > to the component that backs the control domain. Leave the comment > unchanged since it now unambiguously refers to that component. > > No functional change. > > Signed-off-by: Reinette Chatre > --- > drivers/resctrl/mpam_resctrl.c | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/drivers/resctrl/mpam_resctrl.c b/drivers/resctrl/mpam_resctrl.c > index 3d5f90f9f1f3..b07e5dd895dd 100644 > --- a/drivers/resctrl/mpam_resctrl.c > +++ b/drivers/resctrl/mpam_resctrl.c > @@ -1623,14 +1623,14 @@ mpam_resctrl_alloc_domain(unsigned int cpu, struct mpam_resctrl_res *res) > struct rdt_l3_mon_domain *mon_d; > struct rdt_ctrl_domain *ctrl_d; > struct mpam_class *class = res->class; > - struct mpam_component *ctrl_comp; > + struct mpam_component *comp; > struct rdt_resource *r = &res->resctrl_res; Reviewed-by: Jinjie Ruan > > lockdep_assert_held(&domain_list_lock); > > - ctrl_comp = find_component(class, cpu); > + comp = find_component(class, cpu); > /* class has no component for this CPU */ > - if (WARN_ON_ONCE(!ctrl_comp)) > + if (WARN_ON_ONCE(!comp)) > return ERR_PTR(-EINVAL); > > dom = kzalloc_node(sizeof(*dom), GFP_KERNEL, cpu_to_node(cpu)); > @@ -1638,10 +1638,10 @@ mpam_resctrl_alloc_domain(unsigned int cpu, struct mpam_resctrl_res *res) > return ERR_PTR(-ENOMEM); > > if (r->alloc_capable) { > - dom->ctrl_comp = ctrl_comp; > + dom->ctrl_comp = comp; > > ctrl_d = &dom->resctrl_ctrl_dom; > - mpam_resctrl_domain_hdr_init(cpu, ctrl_comp, r->rid, &ctrl_d->hdr); > + mpam_resctrl_domain_hdr_init(cpu, comp, r->rid, &ctrl_d->hdr); > ctrl_d->hdr.type = RESCTRL_CTRL_DOMAIN; > err = resctrl_online_ctrl_domain(r, ctrl_d); > if (err) -- Best regards, Jinjie