From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 686662FD1DC; Tue, 27 Jan 2026 22:10:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769551824; cv=none; b=OPbfZroYkGaL7U+PCUa0hq3qcBQcNF0jG4TtxO4bh3RRYK9Yudw9+/lLccvmeeHFS+Fhv6DyYiMbjjYnjCVlQcPJpZkfV5lu8pp2Rm2jd/NiflJVLXksMgkleqlUuHMPfxwtgHl/lAQ/+tbnk/85nhf/zfRlswFA5LSEyke0IE8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769551824; c=relaxed/simple; bh=T1bfZ5aiqTQ/sFSevXZf16ujCOKTGhTUPz9xxVI+OQU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Q1auxA5WX/HOw+oFHDr02xSb/z5dUYp1P4qncYzhjXfAp8LNDw3A0RW6rLn2pXtMvbu8vTURRNpYHJYYBHhSzurgDsNP0tPoEmpjzpQcAPRvLaBhIEnX16iov3ZQ/ng5Jlxvk1FK1MfXUSv1K01DkdwB+2SpEibQac5bGMe8WrM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=asPY2b0P; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="asPY2b0P" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8D7BBC116C6; Tue, 27 Jan 2026 22:10:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769551824; bh=T1bfZ5aiqTQ/sFSevXZf16ujCOKTGhTUPz9xxVI+OQU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=asPY2b0P6PTxKcgn4M/EQv/eeC1mZP3TX0FYuO7SbRXPsYEaEM/LfHs4TtxZSRKZe xDQLyWtCJUluiWJd+ja/iK5bZTl2zLJCDWSLht/9SVQakZyMl1mzjL55OCIyvlMssf G9aHp9VaACCCCysb3hCy/ctc9+ej1Hby4dxXZwxjJC7leJlxqKdyUfzbfEysYyaZVc Y7UlCk3OUwxepQx1YU1F5cD0nUbQT7TeDR8+0psU/AuSN3tsl4Mf5uyxl/ipycliU+ awcN419Rv3urC4pBbrj11ub5xYPS3Zogq9x9jDFIbu8neFnBRsZnPCO4zVuRpF4stI CepEPah88+eXg== Date: Tue, 27 Jan 2026 14:10:22 -0800 From: Drew Fustini To: yunhui cui Cc: Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Radim =?utf-8?B?S3LEjW3DocWZ?= , Samuel Holland , Adrien Ricciardi , Nicolas Pitre , Kornel =?utf-8?Q?Dul=C4=99ba?= , Atish Patra , Atish Kumar Patra , Vasudevan Srinivasan , Ved Shanbhogue , Chen Pei , Liu Zhiwei , Weiwei Li , guo.wenjia23@zte.com.cn, liu.qingtao2@zte.com.cn, Conor Dooley , Krzysztof Kozlowski , Rob Herring , Reinette Chatre , Tony Luck , Babu Moger , Peter Newman , Fenghua Yu , James Morse , Ben Horgan , Dave Martin , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, x86@kernel.org Subject: Re: [External] [PATCH RFC 08/19] RISC-V: QoS: add resctrl interface for CBQRI controllers Message-ID: References: <20260119-ssqosid-cbqri-v1-0-aa2a75153832@kernel.org> <20260119-ssqosid-cbqri-v1-8-aa2a75153832@kernel.org> Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Mon, Jan 26, 2026 at 01:02:12PM -0800, Drew Fustini wrote: > On Mon, Jan 26, 2026 at 09:01:30PM +0800, yunhui cui wrote: > > Hi Drew, > > > > On Tue, Jan 20, 2026 at 12:15 PM Drew Fustini wrote: > > > > > > Add interface for CBQRI controller drivers to make use of the resctrl > > > filesystem. > > > > > > Co-developed-by: Adrien Ricciardi > > > Signed-off-by: Adrien Ricciardi > > > Signed-off-by: Drew Fustini > > > --- > > > arch/riscv/kernel/qos/qos_resctrl.c | 1191 +++++++++++++++++++++++++++++++++++ > > > 1 file changed, 1191 insertions(+) > > > > > > diff --git a/arch/riscv/kernel/qos/qos_resctrl.c b/arch/riscv/kernel/qos/qos_resctrl.c > > > new file mode 100644 > > > index 000000000000..5e3a65342e9b > > > --- /dev/null > > > +++ b/arch/riscv/kernel/qos/qos_resctrl.c [..] > > > + case RDT_RESOURCE_MBA: > > > + /* Capacity read limit operation for RCID (closid) */ > > > + err = cbqri_bc_alloc_op(ctrl, CBQRI_CC_ALLOC_CTL_OP_READ_LIMIT, closid); > > > + if (err < 0) { > > > + pr_err("%s(): operation failed: err = %d", __func__, err); > > > + return -EIO; > > > + } > > > + > > > + hw_dom->ctrl_val[closid] = cbqri_get_rbwb(ctrl); > > > + > > > + /* Convert from bandwidth blocks to percent */ > > > + rbwb = hw_dom->ctrl_val[closid]; > > > + rbwb *= 100; > > > + percent = rbwb / ctrl->bc.nbwblks; > > > + if (rbwb % ctrl->bc.nbwblks) > > > + percent++; > > > > set: 10, get 11 ? > > The intention was to handle rounding up but I can drop this increment. Actually, this increment of one is necessary. Without it, the default value of 80% will be displayed as 79%. And writing a value like 55% will result in 54%. # mount -t resctrl resctrl /sys/fs/resctrl # cd /sys/fs/resctrl # cat schemata MB:0=79;1=79;2=79 L2:4=fff;5=fff L3:3=ffff # echo 'MB:2=55' > schemata # cat schemata MB:0=79;1=79;2=54 L2:4=fff;5=fff L3:3=ffff # echo 'MB:2=80' > schemata # cat schemata MB:0=79;1=79;2=79 L2:4=fff;5=fff L3:3=ffff Thanks, Drew