From: Drew Fustini <fustini@kernel.org>
To: guo.wenjia23@zte.com.cn
Cc: dave.martin@arm.com, acpica-devel@lists.linux.dev, alex@ghiti.fr,
aou@eecs.berkeley.edu, aricciardi@baylibre.com,
atish.patra@linux.dev, atishp@rivosinc.com, babu.moger@amd.com,
ben.horgan@arm.com, conor+dt@kernel.org,
cp0613@linux.alibaba.com, cuiyunhui@bytedance.com,
devicetree@vger.kernel.org, fenghua.yu@intel.com,
james.morse@arm.com, krzk+dt@kernel.org, lenb@kernel.org,
linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-riscv@lists.infradead.org, liu.qingtao2@zte.com.cn,
liwei1518@gmail.com, mindal@semihalf.com, npitre@baylibre.com,
palmer@dabbelt.com, paul.walmsley@sifive.com,
peternewman@google.com, pjw@kernel.org, rafael@kernel.org,
reinette.chatre@intel.com, rkrcmar@ventanamicro.com,
robert.moore@intel.com, robh@kernel.org,
samuel.holland@sifive.com, sunilvl@ventanamicro.com,
tony.luck@intel.com, vasu@rivosinc.com, ved@rivosinc.com,
x86@kernel.org, zhiwei_liu@linux.alibaba.com
Subject: Re: [PATCH RFC 08/19] RISC-V: QoS: add resctrl interface for CBQRI controllers
Date: Mon, 30 Mar 2026 22:57:54 -0700 [thread overview]
Message-ID: <actiYi6ACcOrvz9J@gen8> (raw)
In-Reply-To: <202603261113.62QBDn8T007047@mse-db.zte.com.cn>
On Thu, Mar 26, 2026 at 07:05:48PM +0800, guo.wenjia23@zte.com.cn wrote:
> Hi Drew,
>
> On Thu, Jan 29, 2026 at 4:28 AM Drew Fustini <fustini@kernel.org> wrote:>
> > Add interface for CBQRI controller drivers to make use of the resctrl
> > filesystem.
> >
> > Co-developed-by: Adrien Ricciardi <aricciardi@baylibre.com>
> > Signed-off-by: Adrien Ricciardi <aricciardi@baylibre.com>
> > Signed-off-by: Drew Fustini <fustini@kernel.org>
> > ---
> > arch/riscv/kernel/qos/qos_resctrl.c | 1192 +++++++++++++++++++++++++++++++++++
> > 1 file changed, 1192 insertions(+)
> >
> > ...
> >
> > +
> > +int resctrl_arch_update_one(struct rdt_resource *r, struct rdt_ctrl_domain *d,
> > + u32 closid, enum resctrl_conf_type t, u32 cfg_val)
> > +{
> > + struct cbqri_controller *ctrl;
> > + struct cbqri_resctrl_dom *dom;
> > + struct cbqri_config cfg;
> > + int err = 0;
> > +
> > + dom = container_of(d, struct cbqri_resctrl_dom, resctrl_ctrl_dom);
> > + ctrl = dom->hw_ctrl;
> > +
> > + if (!r->alloc_capable)
> > + return -EINVAL;
> > +
> > + switch (r->rid) {
> > + case RDT_RESOURCE_L2:
> > + case RDT_RESOURCE_L3:
> > + cfg.cbm = cfg_val;
> > + err = cbqri_apply_cache_config(dom, closid, t, &cfg);
> > + break;
> > + case RDT_RESOURCE_MBA:
> > + /* covert from percentage to bandwidth blocks */
> > + cfg.rbwb = cfg_val * ctrl->bc.nbwblks / 100;
>
> Should use bc.mrbwb to calculate rbwb?
> I think bc.nbwblks represent the available bw blks in the controller.
> It should should decrease as they are allocated.
The resctrl MBA resource is supposed to be the percentage of total
memory bandwidth. nbwblks is the total number of bandwidth blocks, so I
think the existing calucation is correct.
From the example SoC configuration, the number of bandwidth blocks is
1024, and mrbwb is meant to be 80% of nbwblks which is 819.
Setting MB to 80% in schemata would yield: 80 * 1024 / 100 = 819
Thanks,
Drew
WARNING: multiple messages have this Message-ID (diff)
From: Drew Fustini <fustini@kernel.org>
To: guo.wenjia23@zte.com.cn
Cc: x86@kernel.org, atish.patra@linux.dev, aricciardi@baylibre.com,
atishp@rivosinc.com, cp0613@linux.alibaba.com,
cuiyunhui@bytedance.com, zhiwei_liu@linux.alibaba.com,
linux-riscv@lists.infradead.org, vasu@rivosinc.com,
robh@kernel.org, alex@ghiti.fr, rafael@kernel.org,
acpica-devel@lists.linux.dev, robert.moore@intel.com,
liu.qingtao2@zte.com.cn, linux-acpi@vger.kernel.org,
ben.horgan@arm.com, palmer@dabbelt.com, rkrcmar@ventanamicro.com,
dave.martin@arm.com, lenb@kernel.org, devicetree@vger.kernel.org,
conor+dt@kernel.org, aou@eecs.berkeley.edu, mindal@semihalf.com,
babu.moger@amd.com, liwei1518@gmail.com, npitre@baylibre.com,
paul.walmsley@sifive.com, ved@rivosinc.com,
reinette.chatre@intel.com, pjw@kernel.org, tony.luck@intel.com,
peternewman@google.com, linux-kernel@vger.kernel.org,
fenghua.yu@intel.com, samuel.holland@sifive.com,
james.morse@arm.com, krzk+dt@kernel.org
Subject: Re: [PATCH RFC 08/19] RISC-V: QoS: add resctrl interface for CBQRI controllers
Date: Mon, 30 Mar 2026 22:57:54 -0700 [thread overview]
Message-ID: <actiYi6ACcOrvz9J@gen8> (raw)
In-Reply-To: <202603261113.62QBDn8T007047@mse-db.zte.com.cn>
On Thu, Mar 26, 2026 at 07:05:48PM +0800, guo.wenjia23@zte.com.cn wrote:
> Hi Drew,
>
> On Thu, Jan 29, 2026 at 4:28 AM Drew Fustini <fustini@kernel.org> wrote:>
> > Add interface for CBQRI controller drivers to make use of the resctrl
> > filesystem.
> >
> > Co-developed-by: Adrien Ricciardi <aricciardi@baylibre.com>
> > Signed-off-by: Adrien Ricciardi <aricciardi@baylibre.com>
> > Signed-off-by: Drew Fustini <fustini@kernel.org>
> > ---
> > arch/riscv/kernel/qos/qos_resctrl.c | 1192 +++++++++++++++++++++++++++++++++++
> > 1 file changed, 1192 insertions(+)
> >
> > ...
> >
> > +
> > +int resctrl_arch_update_one(struct rdt_resource *r, struct rdt_ctrl_domain *d,
> > + u32 closid, enum resctrl_conf_type t, u32 cfg_val)
> > +{
> > + struct cbqri_controller *ctrl;
> > + struct cbqri_resctrl_dom *dom;
> > + struct cbqri_config cfg;
> > + int err = 0;
> > +
> > + dom = container_of(d, struct cbqri_resctrl_dom, resctrl_ctrl_dom);
> > + ctrl = dom->hw_ctrl;
> > +
> > + if (!r->alloc_capable)
> > + return -EINVAL;
> > +
> > + switch (r->rid) {
> > + case RDT_RESOURCE_L2:
> > + case RDT_RESOURCE_L3:
> > + cfg.cbm = cfg_val;
> > + err = cbqri_apply_cache_config(dom, closid, t, &cfg);
> > + break;
> > + case RDT_RESOURCE_MBA:
> > + /* covert from percentage to bandwidth blocks */
> > + cfg.rbwb = cfg_val * ctrl->bc.nbwblks / 100;
>
> Should use bc.mrbwb to calculate rbwb?
> I think bc.nbwblks represent the available bw blks in the controller.
> It should should decrease as they are allocated.
The resctrl MBA resource is supposed to be the percentage of total
memory bandwidth. nbwblks is the total number of bandwidth blocks, so I
think the existing calucation is correct.
From the example SoC configuration, the number of bandwidth blocks is
1024, and mrbwb is meant to be 80% of nbwblks which is 819.
Setting MB to 80% in schemata would yield: 80 * 1024 / 100 = 819
Thanks,
Drew
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
next prev parent reply other threads:[~2026-03-31 5:57 UTC|newest]
Thread overview: 62+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-20 4:14 [PATCH RFC 00/19] RISC-V: QoS: add CBQRI resctrl interface Drew Fustini
2026-01-20 4:14 ` Drew Fustini
2026-01-20 4:14 ` [PATCH RFC 01/19] dt-bindings: riscv: Add Ssqosid extension description Drew Fustini
2026-01-20 4:14 ` Drew Fustini
2026-01-20 4:14 ` [PATCH RFC 02/19] RISC-V: Detect the Ssqosid extension Drew Fustini
2026-01-20 4:14 ` Drew Fustini
2026-01-20 4:14 ` [PATCH RFC 03/19] RISC-V: Add support for srmcfg CSR from Ssqosid ext Drew Fustini
2026-01-20 4:14 ` Drew Fustini
2026-01-20 4:14 ` [PATCH RFC 04/19] RISC-V: QoS: define properties of CBQRI controllers Drew Fustini
2026-01-20 4:14 ` Drew Fustini
2026-01-20 4:14 ` [PATCH RFC 05/19] RISC-V: QoS: define CBQRI capacity and bandwidth capabilities Drew Fustini
2026-01-20 4:14 ` Drew Fustini
2026-01-20 4:14 ` [PATCH RFC 06/19] RISC-V: QoS: define CBQRI resctrl resources and domains Drew Fustini
2026-01-20 4:14 ` Drew Fustini
2026-01-20 4:14 ` [PATCH RFC 07/19] RISC-V: QoS: define prototypes for resctrl interface Drew Fustini
2026-01-20 4:14 ` Drew Fustini
2026-01-20 4:14 ` [PATCH RFC 08/19] RISC-V: QoS: add resctrl interface for CBQRI controllers Drew Fustini
2026-01-20 4:14 ` Drew Fustini
2026-01-26 13:01 ` [External] " yunhui cui
2026-01-26 13:01 ` yunhui cui
2026-01-26 21:02 ` Drew Fustini
2026-01-26 21:02 ` Drew Fustini
2026-01-27 22:10 ` Drew Fustini
2026-01-27 22:10 ` Drew Fustini
2026-03-26 11:05 ` guo.wenjia23
2026-03-26 11:05 ` guo.wenjia23
2026-03-31 5:57 ` Drew Fustini [this message]
2026-03-31 5:57 ` Drew Fustini
2026-03-31 8:14 ` guo.wenjia23
2026-03-31 8:14 ` guo.wenjia23
2026-01-20 4:14 ` [PATCH RFC 09/19] RISC-V: QoS: expose implementation to resctrl Drew Fustini
2026-01-20 4:14 ` Drew Fustini
2026-01-20 4:14 ` [PATCH RFC 10/19] RISC-V: QoS: add late_initcall to setup resctrl interface Drew Fustini
2026-01-20 4:14 ` Drew Fustini
2026-01-20 4:14 ` [PATCH RFC 11/19] RISC-V: QoS: add to build when CONFIG_RISCV_ISA_SSQOSID set Drew Fustini
2026-01-20 4:14 ` Drew Fustini
2026-01-20 4:14 ` [PATCH RFC 12/19] RISC-V: QoS: make CONFIG_RISCV_ISA_SSQOSID select resctrl Drew Fustini
2026-01-20 4:14 ` Drew Fustini
2026-01-20 4:14 ` [PATCH RFC 13/19] dt-bindings: riscv: add riscv,cbqri bindings Drew Fustini
2026-01-20 4:14 ` Drew Fustini
2026-01-20 4:14 ` [PATCH NFU RFC 14/19] resctrl: riscv: add CBQRI cache controller driver Drew Fustini
2026-01-20 4:14 ` Drew Fustini
2026-01-20 4:14 ` [PATCH NFU RFC 15/19] resctrl: riscv: add CBQRI bandwidth " Drew Fustini
2026-01-20 4:14 ` Drew Fustini
2026-01-20 4:14 ` [PATCH NFU RFC 16/19] resctrl: riscv: build CBQRI drivers Drew Fustini
2026-01-20 4:14 ` Drew Fustini
2026-01-20 4:14 ` [PATCH NFU RFC 17/19] riscv: dts: qemu: add dump from virt machine Drew Fustini
2026-01-20 4:14 ` Drew Fustini
2026-01-20 4:14 ` [PATCH NFU RFC 18/19] riscv: dts: qemu: add CBQRI controller nodes Drew Fustini
2026-01-20 4:14 ` Drew Fustini
2026-01-20 4:14 ` [PATCH NFU RFC 19/19] riscv: dts: build qemu dtb for CONFIG_ARCH_VIRT Drew Fustini
2026-01-20 4:14 ` Drew Fustini
2026-01-22 22:31 ` [PATCH RFC 00/19] RISC-V: QoS: add CBQRI resctrl interface Reinette Chatre
2026-01-22 22:31 ` Reinette Chatre
2026-01-24 18:00 ` Drew Fustini
2026-01-24 18:00 ` Drew Fustini
2026-01-26 13:14 ` [External] " yunhui cui
2026-01-26 13:14 ` yunhui cui
2026-01-26 20:11 ` Drew Fustini
2026-01-26 20:11 ` Drew Fustini
2026-01-27 2:33 ` yunhui cui
2026-01-27 2:33 ` yunhui cui
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=actiYi6ACcOrvz9J@gen8 \
--to=fustini@kernel.org \
--cc=acpica-devel@lists.linux.dev \
--cc=alex@ghiti.fr \
--cc=aou@eecs.berkeley.edu \
--cc=aricciardi@baylibre.com \
--cc=atish.patra@linux.dev \
--cc=atishp@rivosinc.com \
--cc=babu.moger@amd.com \
--cc=ben.horgan@arm.com \
--cc=conor+dt@kernel.org \
--cc=cp0613@linux.alibaba.com \
--cc=cuiyunhui@bytedance.com \
--cc=dave.martin@arm.com \
--cc=devicetree@vger.kernel.org \
--cc=fenghua.yu@intel.com \
--cc=guo.wenjia23@zte.com.cn \
--cc=james.morse@arm.com \
--cc=krzk+dt@kernel.org \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=liu.qingtao2@zte.com.cn \
--cc=liwei1518@gmail.com \
--cc=mindal@semihalf.com \
--cc=npitre@baylibre.com \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=peternewman@google.com \
--cc=pjw@kernel.org \
--cc=rafael@kernel.org \
--cc=reinette.chatre@intel.com \
--cc=rkrcmar@ventanamicro.com \
--cc=robert.moore@intel.com \
--cc=robh@kernel.org \
--cc=samuel.holland@sifive.com \
--cc=sunilvl@ventanamicro.com \
--cc=tony.luck@intel.com \
--cc=vasu@rivosinc.com \
--cc=ved@rivosinc.com \
--cc=x86@kernel.org \
--cc=zhiwei_liu@linux.alibaba.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.