From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=113.46.200.218 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1793088465; b=sDbOPRLGKtmvrs7WyNQGeR0mkyMdL0GBD4RiSMjZ5UDJWpAq4eNAa5E8qQbz8lD679QO AHNTxkKCetN2EHOzvNEH8LY6KkQvwMSc4lZGeG6CVLufxbjUyXpdU1SrO+W4LLootdmgR U2/kn8nXDVpdXAuWvAd62mlSqZyvC0qCAodzItXy9hzRED3p5sTdCs7zxb+xVKnAHn4NY +BWJ6gYy5n8UqGrDWIzOBW2E3u8JhwnE4zVgpk+Or1KTEJtRoRU/V3jRPzEU5PghcUOA+ znnmQXfw4cHLl+KSyRqMn0Dj3fycxKJkkyfSz0QgzorE8o6qzuMSU4pw9q6UN/XoKqg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793088465; h=DMARC-Filter:dkim-signature:Received:Received:Received:Message-ID: Date:MIME-Version:User-Agent:Subject:To:CC:References:From: In-Reply-To:Content-Type:Content-Transfer-Encoding:X-Originating-IP: X-ClientProxiedBy; bh=0243sCBpCNcmZDAWTzlEENPZT2gXQuSJvy2mR0kQ7DA=; b=RsCjy1BaJU3Ph9wc+rw3ijT8NEkkhT8swuzH+BunpUMAvBbQH0qkK43QzxSpO9OLeRKh OMMZkwuFA1peCwiuqn94KJubZhjvHfYTNpU0i1jvuKtukYml0KP9jGyMF0MIlEDj1aaCk 7tQXWw9GjFv1OIOxBM+Ou2+7D1WVBuDGhND426SmDpgWzce3++K49gNsTyQirK8cdLeiD yK8OhLC6rYwqFsTaYvK6Cjy2VWEtDP+YdBjbEnVSeUlmmSvRM7NUK8FaGxvaK+9EDI+tM lPBlzN/Ams23XGLNlC8N7qsjaHRd4WkWTE2WaKVhVOAbQ5IXB7076sWn1M6VypIA/2A== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; dkim=pass header.d=huawei.com header.i=@huawei.com header.a=rsa-sha256 header.s=dkim header.b=bA5BgE5I; arc=none smtp.remote-ip=113.46.200.218 Received: from canpmsgout03.his.huawei.com (canpmsgout03.his.huawei.com [113.46.200.218]) (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 81629606A32E for ; Tue, 27 Oct 2026 08:07:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 81629606A32E 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=huawei.com header.i=@huawei.com header.a=rsa-sha256 header.s=dkim header.b=bA5BgE5I dkim-signature: v=1; a=rsa-sha256; d=huawei.com; s=dkim; c=relaxed/relaxed; q=dns/txt; h=From; bh=0243sCBpCNcmZDAWTzlEENPZT2gXQuSJvy2mR0kQ7DA=; b=bA5BgE5ILkwOFIkh8UBXWjEQC9n5v7dblWsgX27NCKFjPz8B4BLTy8l581wEltSJmyJVffTfY ppcaZMkelRaFEKGveLhUJhr6g7/4H6ghrBAk8etNkPmz59XXz/HNXmAvAl5pO0j7rgxzbAhKCUX 8Se+qUSTrQuDf2/9VNBY78Q= Received: from mail.maildlp.com (unknown [172.19.162.144]) by canpmsgout03.his.huawei.com (SkyGuard) with ESMTPS id 4jDNQ33TsdzpSt7; Tue, 27 Oct 2026 16:07:23 +0800 (CST) Received: from kwepemk200008.china.huawei.com (unknown [7.202.194.74]) by mail.maildlp.com (Postfix) with ESMTPS id 27F4540538; Tue, 27 Oct 2026 16:07:34 +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; Tue, 27 Oct 2026 16:07:33 +0800 Message-ID: <2b7e4de7-ad06-40a1-92e0-479b3d7812af@huawei.com> Date: Tue, 27 Oct 2026 16:07:32 +0800 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 1/5] x86,fs/resctrl: Remove unused non-linear bandwidth delay mapping To: Reinette Chatre , , , , , , , , CC: , , , , , , , References: <103c954ead8905b3582b6ade76e2082dffb01fc6.1791406459.git.reinette.chatre@intel.com> From: Jinjie Ruan In-Reply-To: <103c954ead8905b3582b6ade76e2082dffb01fc6.1791406459.git.reinette.chatre@intel.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-ClientProxiedBy: kwepems100001.china.huawei.com (7.221.188.238) To kwepemk200008.china.huawei.com (7.202.194.74) 在 2026/10/8 5:06, Reinette Chatre 写道: > Intel MBA throttles memory bandwidth with delay values, while resctrl > exposes memory bandwidth to user space as a percentage. When delay values > are linear there is a direct mapping between the two. Support for > non-linear delay values would need a pre-calibrated table mapping > percentages to delay values. > > Commit > > 05b93417ce5b ("x86/intel_rdt/mba: Add primary support for Memory Bandwidth Allocation (MBA)") > > added a placeholder for such a table to the resctrl_membw structure, but > the table was never populated and never read. rdt_get_mb_table(), which > would provide it, always fails. As a result, an Intel MBA resource with > non-linear delay values is never marked as capable of allocation, and its > control values are never written to hardware. > > Remove the unused mapping table and fold the linear percentage-to-delay > conversion into the function that writes the control values to hardware. > > Keep the check that delay values are linear as a defensive measure in > preparation for supporting multiple controls, which turns the memory > bandwidth control into a generic scalar control that indicates whether it > requires linear values. > > Signed-off-by: Reinette Chatre > Reviewed-by: Chen Yu > --- > Changes since RFC v1: > - Also drop separate delay_bw_map() and instead integrate the only > mapping to when control value is written. > > Changes since RFC v2: > - Rework changelog. > > Changes since v1: > - Rewrite changelog, fix subject prefix. > - Match error message about linear support with similar message during > enumeration added in next patch. > - Add Chenyu's Reviewed-by tag > --- > arch/x86/kernel/cpu/resctrl/core.c | 23 +++++++---------------- > include/linux/resctrl.h | 2 -- > 2 files changed, 7 insertions(+), 18 deletions(-) > > diff --git a/arch/x86/kernel/cpu/resctrl/core.c b/arch/x86/kernel/cpu/resctrl/core.c > index 55214d6fdc49..f9677e52790e 100644 > --- a/arch/x86/kernel/cpu/resctrl/core.c > +++ b/arch/x86/kernel/cpu/resctrl/core.c > @@ -323,29 +323,20 @@ static void mba_wrmsr_amd(struct msr_param *m) > wrmsrq(hw_res->msr_base + i, hw_dom->ctrl_val[i]); > } > > -/* > - * Map the memory b/w percentage value to delay values > - * that can be written to QOS_MSRs. > - * There are currently no SKUs which support non linear delay values. > - */ > -static u32 delay_bw_map(unsigned long bw, struct rdt_resource *r) > -{ > - if (r->membw.delay_linear) > - return MAX_MBA_BW - bw; > - > - pr_warn_once("Non Linear delay-bw map not supported but queried\n"); > - return MAX_MBA_BW; > -} > - > static void mba_wrmsr_intel(struct msr_param *m) > { > struct rdt_hw_ctrl_domain *hw_dom = resctrl_to_arch_ctrl_dom(m->dom); > struct rdt_hw_resource *hw_res = resctrl_to_arch_res(m->res); > unsigned int i; > > - /* Write the delay values for mba. */ > + if (!m->res->membw.delay_linear) { > + pr_warn_once("Non-linear MBA delay values not supported\n"); > + return; > + } > + > + /* Program bandwidth percentage mapped to linear delay value. */ > for (i = m->low; i < m->high; i++) > - wrmsrq(hw_res->msr_base + i, delay_bw_map(hw_dom->ctrl_val[i], m->res)); > + wrmsrq(hw_res->msr_base + i, MAX_MBA_BW - hw_dom->ctrl_val[i]); LGTM Reviewed-by: Jinjie Ruan > } > > static void cat_wrmsr(struct msr_param *m) > diff --git a/include/linux/resctrl.h b/include/linux/resctrl.h > index 10dfdca7f4bf..b63dc62690ca 100644 > --- a/include/linux/resctrl.h > +++ b/include/linux/resctrl.h > @@ -253,7 +253,6 @@ enum membw_throttle_mode { > * @throttle_mode: Bandwidth throttling mode when threads request > * different memory bandwidths > * @mba_sc: True if MBA software controller(mba_sc) is enabled > - * @mb_map: Mapping of memory B/W percentage to memory B/W delay > */ > struct resctrl_membw { > u32 min_bw; > @@ -263,7 +262,6 @@ struct resctrl_membw { > bool arch_needs_linear; > enum membw_throttle_mode throttle_mode; > bool mba_sc; > - u32 *mb_map; > }; > > struct resctrl_schema; -- Best regards, Jinjie