From: "Zeng Heng" <zengheng@picoheart.com>
To: "Drew Fustini" <fustini@kernel.org>,
"Adrien Ricciardi" <aricciardi@baylibre.com>,
"Alexandre Ghiti" <alex@ghiti.fr>,
"Albert Ou" <aou@eecs.berkeley.edu>,
"Atish Patra" <atish.patra@linux.dev>,
"Babu Moger" <babu.moger@amd.com>,
"Ben Horgan" <ben.horgan@arm.com>,
"Borislav Petkov" <bp@alien8.de>,
"Chen Pei" <cp0613@linux.alibaba.com>,
"Conor Dooley" <conor.dooley@microchip.com>,
"Conor Dooley" <conor+dt@kernel.org>,
"Dave Hansen" <dave.hansen@linux.intel.com>,
"Dave Martin" <Dave.Martin@arm.com>,
"Fenghua Yu" <fenghuay@nvidia.com>,
"Gong Shuai" <gong.shuai@sanechips.com.cn>,
"Gong Shuai" <gsh517@gmail.com>,
guo.wenjia23@zte.com.cn, "James Morse" <james.morse@arm.com>,
"Kornel Dulęba" <mindal@semihalf.com>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
liu.qingtao2@zte.com.cn,
"Liu Zhiwei" <zhiwei_liu@linux.alibaba.com>,
"Palmer Dabbelt" <palmer@dabbelt.com>,
"Paul Walmsley" <pjw@kernel.org>,
"Peter Newman" <peternewman@google.com>,
"Radim Krčmář" <radim.krcmar@oss.qualcomm.com>,
"Reinette Chatre" <reinette.chatre@intel.com>,
"Rob Herring" <robh@kernel.org>,
"Samuel Holland" <samuel.holland@sifive.com>,
"Sunil V L" <sunilvl@oss.qualcomm.com>,
"Tony Luck" <tony.luck@intel.com>,
"Weiwei Li" <liwei1518@gmail.com>,
"yunhui cui" <cuiyunhui@bytedance.com>,
"Zhanpeng Zhang" <zhangzhanpeng.jasper@bytedance.com>
Cc: "Catalin Marinas" <catalin.marinas@arm.com>,
"Jonathan Cameron" <jic23@kernel.org>,
"Shaopeng Tan" <tan.shaopeng@jp.fujitsu.com>,
<linux-kernel@vger.kernel.org>,
<linux-riscv@lists.infradead.org>, <x86@kernel.org>,
<devicetree@vger.kernel.org>, <linux-doc@vger.kernel.org>,
<yang.yicong@picoheart.com>, <geshijian@picoheart.com>
Subject: Re: [PATCH v10 2/6] riscv_cbqri: resctrl: Add cache allocation via capacity block mask
Date: Thu, 5 Nov 2026 16:05:29 +0800 [thread overview]
Message-ID: <02cf71f0-09d5-4dde-a8cf-3739583cc7fa@picoheart.com> (raw)
In-Reply-To: <20261104-dfustini-atl-sc-cbqri-dt-v10-2-1636a003a3c0@kernel.org>
Hi Drew,
在 11/5/26 上午12:35, Drew Fustini 写道:
...
> +/*
> + * Fill the rdt_resource fields for one picked rid. An rid with no picked
> + * controller is left untouched so it stays out of resctrl_arch_get_resource().
> + */
> +static void cbqri_resctrl_control_init(struct cbqri_resctrl_res *cbqri_res)
> +{
> + struct rdt_resource *res = &cbqri_res->resctrl_res;
> + struct cbqri_controller *ctrl;
> +
> + if (!cbqri_res->nr_ctrls)
> + return;
> + ctrl = cbqri_res->ctrls[0];
> +
> + switch (res->rid) {
> + case RDT_RESOURCE_L2:
> + case RDT_RESOURCE_L3:
> + res->name = (res->rid == RDT_RESOURCE_L2) ? "L2" : "L3";
> + res->schema_fmt = RESCTRL_SCHEMA_BITMAP;
> + res->ctrl_scope = (res->rid == RDT_RESOURCE_L2) ?
> + RESCTRL_L2_CACHE : RESCTRL_L3_CACHE;
> + res->cache.cbm_len = ctrl->cc.ncblks;
> + res->cache.shareable_bits = 0;
> + res->cache.min_cbm_bits = 1;
> + res->cache.arch_has_sparse_bitmasks = false;
Currently, the driver sets arch_has_sparse_bitmasks to false, causing
resctrl to require a contiguous bits in cache allocation masks. For
example, L3:0=3 is accepted, whereas L3:0=11 is rejected because its
set bits are non-contiguous.
The default should allow both contiguous and non-contiguous masks,
provided they satisfy the other mask validity checks. A contiguity
restriction should only be imposed when a specific hardware
implementation can't support sparse masks explicitly.
So I propose enabling sparse cache allocation bitmasks by default.
Thanks.
> + res->cdp_capable = ctrl->cc.supports_alloc_at_code;
> + res->alloc_capable = ctrl->alloc_capable;
> + INIT_LIST_HEAD(&res->ctrl_domains);
> + INIT_LIST_HEAD(&res->mon_domains);
> + break;
> + default:
> + break;
> + }
> +}
Apart from this,
Reviewed-by: Zeng Heng <zengheng@picoheart.com>
Best regards,
Zeng Heng
next prev parent reply other threads:[~2026-11-05 8:05 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-04 16:35 [PATCH v10 0/6] riscv: Add initial CBQRI resctrl support Drew Fustini
2026-11-04 16:35 ` [PATCH v10 1/6] riscv_cbqri: Add capacity controller core Drew Fustini
2026-11-04 16:35 ` [PATCH v10 2/6] riscv_cbqri: resctrl: Add cache allocation via capacity block mask Drew Fustini
2026-11-05 8:05 ` Zeng Heng [this message]
2026-11-04 16:35 ` [PATCH v10 3/6] riscv_cbqri: Make RESCTRL_FS available on RISC-V Drew Fustini
2026-11-04 16:35 ` [PATCH v10 4/6] dt-bindings: riscv: Add binding for CBQRI controllers Drew Fustini
2026-11-04 16:35 ` [PATCH v10 5/6] riscv_cbqri: Add CBQRI capacity allocation platform driver Drew Fustini
2026-11-04 16:35 ` [PATCH v10 6/6] MAINTAINERS: resctrl: Add myself as reviewer Drew Fustini
2026-11-04 17:05 ` Reinette Chatre
2026-11-05 1:14 ` [tip: x86/urgent] " tip-bot2 for 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=02cf71f0-09d5-4dde-a8cf-3739583cc7fa@picoheart.com \
--to=zengheng@picoheart.com \
--cc=Dave.Martin@arm.com \
--cc=alex@ghiti.fr \
--cc=aou@eecs.berkeley.edu \
--cc=aricciardi@baylibre.com \
--cc=atish.patra@linux.dev \
--cc=babu.moger@amd.com \
--cc=ben.horgan@arm.com \
--cc=bp@alien8.de \
--cc=catalin.marinas@arm.com \
--cc=conor+dt@kernel.org \
--cc=conor.dooley@microchip.com \
--cc=cp0613@linux.alibaba.com \
--cc=cuiyunhui@bytedance.com \
--cc=dave.hansen@linux.intel.com \
--cc=devicetree@vger.kernel.org \
--cc=fenghuay@nvidia.com \
--cc=fustini@kernel.org \
--cc=geshijian@picoheart.com \
--cc=gong.shuai@sanechips.com.cn \
--cc=gsh517@gmail.com \
--cc=guo.wenjia23@zte.com.cn \
--cc=james.morse@arm.com \
--cc=jic23@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-doc@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=palmer@dabbelt.com \
--cc=peternewman@google.com \
--cc=pjw@kernel.org \
--cc=radim.krcmar@oss.qualcomm.com \
--cc=reinette.chatre@intel.com \
--cc=robh@kernel.org \
--cc=samuel.holland@sifive.com \
--cc=sunilvl@oss.qualcomm.com \
--cc=tan.shaopeng@jp.fujitsu.com \
--cc=tony.luck@intel.com \
--cc=x86@kernel.org \
--cc=yang.yicong@picoheart.com \
--cc=zhangzhanpeng.jasper@bytedance.com \
--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
all inboxes | Powered by JetHome®