From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out28-51.mail.aliyun.com (out28-51.mail.aliyun.com [115.124.28.51]) (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 4F1FC1E9B3F for ; Sun, 7 Dec 2025 02:27:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.28.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765074432; cv=none; b=EUyi0Q4F92mfQUHZqwKiHy1OqBbF414VqZpfXAUBV1NGppSbjoxXTveBSwK844gr4Rq57nX/Dlc98wyK6NmIp689e5oZm+m6lFR/rjvq6ZSDArxjAVzmu6ZEsdAsfNUHvsjAtkoS+GgDd6FbQFMW3UTffSUmZ1Ua+JhUprIwcjA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765074432; c=relaxed/simple; bh=iy9ZVYLqWilHAA+X9PrTvs6pnX20/QLj+B1ZD95YNBM=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=btPMZ6nhEDxl2u0C5hqi82skWx6aHmIsF7IeaiUSKUdmVt6cBxz4SwGH4gPFVUSftsRn0ObYHZNA7cdCvgq1IdDC8clcn7WB2ZxemACgcAmCQ7MzUc0WaCDaIX9karUsGNssEGscneDkTGGXtWo4VTABPLYs5RrC76nMLr5fxrI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=open-hieco.net; spf=pass smtp.mailfrom=open-hieco.net; arc=none smtp.client-ip=115.124.28.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=open-hieco.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=open-hieco.net Received: from 172.18.26.4(mailfrom:shenxiaochen@open-hieco.net fp:SMTPD_---.feaOADy_1765074417 cluster:ay29) by smtp.aliyun-inc.com; Sun, 07 Dec 2025 10:26:58 +0800 Message-ID: <6a77f0dd-ea2a-4e2c-bf16-a3d660399051@open-hieco.net> Date: Sun, 7 Dec 2025 10:26:57 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/2] x86/resctrl: Fix memory bandwidth counter width for Hygon To: "Luck, Tony" , "Chatre, Reinette" , "bp@alien8.de" , "fenghuay@nvidia.com" Cc: "babu.moger@amd.com" , "james.morse@arm.com" , "Dave.Martin@arm.com" , "x86@kernel.org" , "linux-kernel@vger.kernel.org" , shenxiaochen@open-hieco.net References: <20251204023750.994143-1-shenxiaochen@open-hieco.net> <20251204023750.994143-3-shenxiaochen@open-hieco.net> <03618cf2-b8c8-4493-a991-04bced42c7dd@open-hieco.net> Content-Language: en-US From: Xiaochen Shen In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Hi Tony, On 12/7/2025 12:14 AM, Xiaochen Shen wrote: >> Question: What is the value of "hw_res->mon_scale" on a Hygon system? > I have double confirmed with Hygon hardware architect, in the testing Hygon system: > hw_res->mon_scale: 64 > hw_res->mbm_width: 32 > > Here is a rough calculation for the theoretical max bandwidth by the hardware counter: > (1) 32-bits width and mon_scale is 64: > 2 ^32 * 64 = 2 ^38 = 256 (B/s) > Sorry. Here is a typo: - 2 ^32 * 64 = 2 ^38 = 256 (B/s) + 2 ^32 * 64 = 2 ^38 = 256G (B/s) > (2) 24-bits width and mon_scale is 64 (this is highly likely to cause overflow): > 2 ^24 * 64 = 2 ^30 = 1G (B/s) Best regards, Xiaochen Shen