mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Aiqun(Maria) Yu" <aiqun.yu@oss.qualcomm.com>
To: James Morse <james.morse@arm.com>,
	Tony Luck <tony.luck@intel.com>,
	Reinette Chatre <reinette.chatre@intel.com>,
	Dave Martin <Dave.Martin@arm.com>,
	Ben Horgan <ben.horgan@arm.com>
Cc: x86@kernel.org, Babu Moger <babu.moger@amd.com>,
	linux-kernel@vger.kernel.org, Fenghua Yu <fenghuay@nvidia.com>,
	Trilok Soni <trilok.soni@oss.qualcomm.com>,
	yiwei.huang@oss.qualcomm.com, yin.li@oss.qualcomm.com
Subject: Re: [BOF]arm: resctrl: L3 cache partitioning via CLUSTERPARTCR
Date: Tue, 1 Dec 2026 15:55:08 +0800	[thread overview]
Message-ID: <c7a5f214-280c-411a-8499-4005fbf512ce@oss.qualcomm.com> (raw)
In-Reply-To: <4179bde1-4ced-48cb-877d-93291c6029e5@arm.com>

On 6/30/2026 10:59 PM, James Morse wrote:
> Hi Aiqun,
> 
> On 30/06/2026 12:48, Aiqun(Maria) Yu wrote:
>> L3 cache partitioning is an important feature for improving performance
>> isolation of latency-sensitive tasks. While ARM MPAM provides a
>> comprehensive solution,
> 
>> there exists another ARM register, CLUSTERPARTCR,
> 
> It's important to note this isn't an ARM architecture feature or register,
> it's part of one version of DSU, which is a shared-cache IP in some designs.


Thx for the correction.
> 
> 
>> which offers L3 cache partitioning functionality similar to MPAM's CPBM
>> (Cache Portion BitMask) but is not part of the MPAM architecture.
> 
> ... and as its not part of any architectural feature, is going to be very hard
> to use.

It is hard, but still useful in some scenario. :)
> 
> 
>> CLUSTERPARTCR is a cluster-level register that allows software to partition
>> L3 cache capacity among different workloads. Although its partitioning
>> granularity and flexibility are more limited compared to full MPAM support,
>> it remains a practically important interface for platforms that do not
>> implement MPAM but still need L3 cache partitioning capability.
> 
> This stuff is designed for static SoC configurations. e.g. CPU-4 is running
> your modem stack. I don't this is going to work well with general purpose
> things like linux and resctrl.
> 
> 
>> This raises the following questions for the community:
>>
>>   1. Is there interest in accommodating CLUSTERPARTCR-based L3 partitioning
>>      within the existing resctrl framework, given that it provides similar
>>      semantics to Intel RDT's cache allocation technology (CAT)?
> 
> I'd say that is impossible.
> 
> This would rely on accessing implementation defined system registers, not just
> in some driver - but in the architecture's context-switch path. This has been a
> hard no in the past. For just the imp-def part, see: [0][1][2]

I see the good point here.
What about if we make the driver more standalone. And not context-switch
path affected. So it can be a scheme ID based configuration only. Only
specific tasks with the same scheme ID will be configured.
> 
> Doing this doesn't virtualise as all those registers are trapped by HCR_EL2.TIDCP,
> the hypervisor can't emulate these registers as they can behave differently on
> each CPU. The only option is to emulate an undefined instruction exception.
> This makes detecting the SoCs where this could be used very difficult.
> 
> 
>>   2. Alternatively, would it be more appropriate to integrate it under the
>>      MPAM resctrl framework as a non-MPAM backend, given the functional
>>      similarity to MPAM CPBM?
> 
> I don't think its at all similar.
> 
> This doesn't map to the L3/CPBM bitmap schema. A group is 4 ways, and the control
> is only to make a group private to an 'ID'. You can't share a group between two
> resctrl groups - which the bitmap schema allows.
> 
> As an ugly corner case: if you tried to express the groups as a bitmap, a 12-way
> cache configuration would have 3 groups - meaning a two bit bitmap has invalid values.
> 
> This is all because its not really a bitmap in hardware.
> 
> 
> The datasheet/TRM you linked doesn't say that the partition controls can be changed
> at runtime. Resctrl requires this.
> While the document doesn't say either way - its very common for interconnect IP to
> expect configuration information to only be written to during power-on, when there
> is no traffic flowing in the system. Linux can't ever do this.

Per current prototype, it can be runtime changed and functional as expected.

> 
> 
>>   3. Are there any concerns or constraints in the current resctrl/MPAM
>>      framework that would prevent such an integration?
> 
> Not just the imp-def system registers: There is no way of detecting whether
> this is present in any particular SoC. You can't have a table of SoCs where
> it happens to be as it also depends on the EL3 firmware to turn this interface
> on, and a hypervisor not being present.
> 
> The system registers imply some knowledge of the topology, its not just which
> CPUs share a DSU,  but where an 'ACP' goes, and what a 'STASH' is for.
> 
> 
> It looks like there are 8 'partition scheme IDs', but only 'four private L3 cache
> partitions can be created' - so depending on what is written to the schema file,
> there may be only four control groups usable.


Good point. So maybe we can have a standalone interface which is static
scheme ID base configuration only. Runtime specific interface to
configure for specific scheme ID. We can have an BOF driver example code
for reference if it is agreed.
> 
> 
>> Any comments, suggestions, or pointers to prior discussion on this topic
>> are very much appreciated.
> I don't think this is workable for either resctrl or the architecture code.
> 
> DSU supports MPAM, so presumably this is for an older version that doesn't have the
> MPAM feature?


yes. Here are the older versions that don't support MPAM.
> 
> 
> Thanks,
> 
> James
> 
> [0] https://lore.kernel.org/linux-arm-kernel/20151026124616.GB9740@leverpostej/
> [1] https://lore.kernel.org/linux-arm-kernel/20201120101249.GA2328@C02TD0UTHF1T.local/
> [2] https://lore.kernel.org/linux-arm-kernel/20210108125410.GA84941@C02TD0UTHF1T.local/


-- 
Thx and BRs,
Aiqun(Maria) Yu

      reply	other threads:[~2026-12-01  7:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-30 11:48 Aiqun(Maria) Yu
2026-06-30 14:59 ` James Morse
2026-12-01  7:55   ` Aiqun(Maria) Yu [this message]

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=c7a5f214-280c-411a-8499-4005fbf512ce@oss.qualcomm.com \
    --to=aiqun.yu@oss.qualcomm.com \
    --cc=Dave.Martin@arm.com \
    --cc=babu.moger@amd.com \
    --cc=ben.horgan@arm.com \
    --cc=fenghuay@nvidia.com \
    --cc=james.morse@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=reinette.chatre@intel.com \
    --cc=tony.luck@intel.com \
    --cc=trilok.soni@oss.qualcomm.com \
    --cc=x86@kernel.org \
    --cc=yin.li@oss.qualcomm.com \
    --cc=yiwei.huang@oss.qualcomm.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®