From: Drew Fustini <fustini@kernel.org>
To: Reinette Chatre <reinette.chatre@intel.com>
Cc: x86@kernel.org, "Atish Patra" <atish.patra@linux.dev>,
"Adrien Ricciardi" <aricciardi@baylibre.com>,
"Atish Kumar Patra" <atishp@rivosinc.com>,
"Conor Dooley" <conor+dt@kernel.org>,
"Nicolas Pitre" <npitre@baylibre.com>,
linux-kernel@vger.kernel.org,
"Gong Shuai" <gong.shuai@sanechips.com.cn>,
"Liu Zhiwei" <zhiwei_liu@linux.alibaba.com>,
guo.wenjia23@zte.com.cn,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
linux-riscv@lists.infradead.org, "Rob Herring" <robh@kernel.org>,
"Alexandre Ghiti" <alex@ghiti.fr>,
"Rafael J. Wysocki" <rafael@kernel.org>,
acpica-devel@lists.linux.dev,
"Robert Moore" <robert.moore@intel.com>,
liu.qingtao2@zte.com.cn, linux-acpi@vger.kernel.org,
"Ben Horgan" <ben.horgan@arm.com>,
"James Morse" <james.morse@arm.com>,
"Radim Krčmář" <rkrcmar@ventanamicro.com>,
"Dave Martin" <Dave.Martin@arm.com>,
"Len Brown" <lenb@kernel.org>, "Gong Shuai" <gsh517@gmail.com>,
"Fenghua Yu" <fenghua.yu@intel.com>,
"Chen Pei" <cp0613@linux.alibaba.com>,
"Albert Ou" <aou@eecs.berkeley.edu>,
"Kornel Dulęba" <mindal@semihalf.com>,
"Babu Moger" <babu.moger@amd.com>,
"Weiwei Li" <liwei1518@gmail.com>,
"yunhui cui" <cuiyunhui@bytedance.com>,
"Paul Walmsley" <paul.walmsley@sifive.com>,
"Ved Shanbhogue" <ved@rivosinc.com>,
"Vasudevan Srinivasan" <vasu@rivosinc.com>,
"Tony Luck" <tony.luck@intel.com>,
"Peter Newman" <peternewman@google.com>,
"Conor Dooley" <conor.dooley@microchip.com>,
"Samuel Holland" <samuel.holland@sifive.com>,
"Palmer Dabbelt" <palmer@dabbelt.com>,
"Paul Walmsley" <pjw@kernel.org>,
devicetree@vger.kernel.org
Subject: Re: [PATCH RFC v3 06/11] RISC-V: QoS: add resctrl setup and domain management
Date: Fri, 1 May 2026 15:56:05 -0700 [thread overview]
Message-ID: <afUvhf4SdKVjLqfk@x1> (raw)
In-Reply-To: <9a8860a5-f63f-497c-ade9-6f64286abff0@intel.com>
On Thu, Apr 30, 2026 at 04:20:09PM -0700, Reinette Chatre wrote:
> Hi Drew,
>
> On 4/14/26 6:54 PM, Drew Fustini wrote:
> > +
> > +static int qos_resctrl_add_controller_domain(struct cbqri_controller *ctrl)
> > +{
> > + struct rdt_ctrl_domain *domain;
> > + struct cbqri_resctrl_res *cbqri_res = NULL;
> > + struct rdt_resource *res = NULL;
> > + struct list_head *pos = NULL;
> > + int err;
> > +
> > + domain = qos_new_domain(ctrl);
> > + if (!domain)
> > + return -ENOSPC;
> > +
> > + switch (ctrl->type) {
> > + case CBQRI_CONTROLLER_TYPE_CAPACITY:
> > + cpumask_copy(&domain->hdr.cpu_mask, &ctrl->cache.cpu_mask);
>
> Looking at patch #10 ctrl->cache.cpu_mask contains all CPUs associated with cache
> even if they are offline. This is not what resctrl expects. Instead the expectation is
> that a domain exists and is online (hence "resctrl_online_ctrl_domain()") if at least one CPU
> belonging to that domain is online and domain->hdr.cpu_mask lists all the *online* CPUs
> associated with that domain.
> This is why resctrl always takes the CPU hotplug lock when traversing the domain
> lists.
>
> I thus expected this initialization to be split between an early initialization of
> resource capabilities and then domain initialization as part of the CPU online/offline
> handlers.
Good point. I'll rework this so that domain allocation moves to the cpu
online/offline handlers.
[..]
> > + if (pos)
> > + list_add_tail(&domain->hdr.list, pos);
> > + else
> > + list_add_tail(&domain->hdr.list, &res->ctrl_domains);
>
> resctrl_find_domain() returns NULL if it cannot find an existing domain, in that
> case it initializes "pos" to support adding a new domain in a sorted list.
> Expectation is that domains are managed as part of CPU hotplug handlers. When
> a CPU comes online then handler can check if the domain it belongs to already exists,
> if it does then the CPU can just be added to that domain's cpu_mask, if it does
> not then a new domain is created and added in the the appropriate spot in the
> sorted list (based on domain ID) of domains.
Okay, I'll move this from probe to qos_resctrl_online_cpu().
> > +int qos_resctrl_online_cpu(unsigned int cpu)
> > +{
> > + resctrl_online_cpu(cpu);
>
> This is where a domain is expected to be added when its first CPU comes online.
[..]
> > +int qos_resctrl_offline_cpu(unsigned int cpu)
> > +{
> > + resctrl_offline_cpu(cpu);
>
> This is where a domain is expected to be removed when its last CPU goes offline.
Okay, I'll update v4 to add and remove domains in these hooks.
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-05-01 22:56 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-15 1:53 [PATCH RFC v3 00/11] RISC-V: QoS: add CBQRI resctrl interface Drew Fustini
2026-04-15 1:53 ` [PATCH RFC v3 01/11] dt-bindings: riscv: Add Ssqosid extension description Drew Fustini
2026-04-15 1:53 ` [PATCH RFC v3 02/11] RISC-V: Detect the Ssqosid extension Drew Fustini
2026-04-15 1:53 ` [PATCH RFC v3 03/11] RISC-V: Add support for srmcfg CSR from " Drew Fustini
2026-04-15 1:53 ` [PATCH RFC v3 04/11] RISC-V: QoS: add CBQRI hardware interface Drew Fustini
2026-04-30 23:15 ` Reinette Chatre
2026-05-01 4:45 ` Drew Fustini
2026-05-05 4:43 ` [External] " yunhui cui
2026-05-06 14:28 ` Drew Fustini
2026-04-15 1:53 ` [PATCH RFC v3 05/11] RISC-V: QoS: add resctrl arch callbacks for CBQRI controllers Drew Fustini
2026-04-30 23:17 ` Reinette Chatre
2026-04-30 23:37 ` Drew Fustini
2026-04-30 23:52 ` Reinette Chatre
2026-04-15 1:54 ` [PATCH RFC v3 06/11] RISC-V: QoS: add resctrl setup and domain management Drew Fustini
2026-04-17 10:52 ` guo.wenjia23
2026-04-18 22:01 ` Drew Fustini
2026-04-30 23:20 ` Reinette Chatre
2026-05-01 22:56 ` Drew Fustini [this message]
2026-04-15 1:54 ` [PATCH RFC v3 07/11] RISC-V: QoS: enable resctrl support for Ssqosid Drew Fustini
2026-04-15 1:54 ` [PATCH RFC v3 08/11] ACPI: PPTT: Add acpi_pptt_get_cache_size_from_id helper Drew Fustini
2026-04-30 23:20 ` Reinette Chatre
2026-05-01 16:53 ` Drew Fustini
2026-04-15 1:54 ` [PATCH RFC v3 09/11] DO NOT MERGE: include: acpi: actbl2: Add structs for RQSC table Drew Fustini
2026-04-15 1:54 ` [PATCH RFC v3 10/11] ACPI: RISC-V: Parse RISC-V Quality of Service Controller (RQSC) table Drew Fustini
2026-04-15 1:54 ` [PATCH RFC v3 11/11] ACPI: RISC-V: Add support for RISC-V Quality of Service Controller (RQSC) Drew Fustini
2026-05-05 4:46 ` [External] [PATCH RFC v3 00/11] RISC-V: QoS: add CBQRI resctrl interface yunhui cui
2026-05-06 14:32 ` Drew Fustini
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=afUvhf4SdKVjLqfk@x1 \
--to=fustini@kernel.org \
--cc=Dave.Martin@arm.com \
--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=conor.dooley@microchip.com \
--cc=cp0613@linux.alibaba.com \
--cc=cuiyunhui@bytedance.com \
--cc=devicetree@vger.kernel.org \
--cc=fenghua.yu@intel.com \
--cc=gong.shuai@sanechips.com.cn \
--cc=gsh517@gmail.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=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox