mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Drew Fustini <fustini@kernel.org>
To: Zeng Heng <zengheng@picoheart.com>
Cc: "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>,
	"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: Fri, 6 Nov 2026 09:05:32 -0800	[thread overview]
Message-ID: <au4I3E_qcPhIr-Qr@thelio> (raw)
In-Reply-To: <02cf71f0-09d5-4dde-a8cf-3739583cc7fa@picoheart.com>

On Thu, Nov 05, 2026 at 04:05:29PM +0800, Zeng Heng wrote:
> Hi Drew,

Hi, thanks for reviewing.

> 在 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.

Good point, I will change arch_has_sparse_bitmasks to true. The spec
defines cc_block_mask as one bit per capacity block and there's no
contiguity requirement.

> > +		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>

Thanks!

Drew

  reply	other threads:[~2026-11-06 17:05 UTC|newest]

Thread overview: 11+ 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
2026-11-06 17:05     ` Drew Fustini [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=au4I3E_qcPhIr-Qr@thelio \
    --to=fustini@kernel.org \
    --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=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=zengheng@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®