mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Reinette Chatre <reinette.chatre@intel.com>
To: Chen Yu <chen.yu@linux.dev>
Cc: Chen Yu <yu.c.chen@intel.com>, <tony.luck@intel.com>,
	<tglx@kernel.org>, <bp@alien8.de>, <mingo@redhat.com>,
	<dave.hansen@linux.intel.com>, <hpa@zytor.com>,
	<fenghuay@nvidia.com>, <babu.moger@amd.com>,
	<hongyu.ning@intel.com>, <x86@kernel.org>,
	<linux-kernel@vger.kernel.org>,
	Hongyu Ning <hongyu.ning@linux.intel.com>
Subject: Re: [PATCH v8 3/9] x86/resctrl: Parse ACPI ERDT table and save CACD cpumask for RMDD domains
Date: Tue, 29 Sep 2026 08:40:57 -0700	[thread overview]
Message-ID: <1d3e429d-fcae-4d60-b107-81128e611993@intel.com> (raw)
In-Reply-To: <aruTxheNOvbT8b7d@three-body>

Hi Chenyu,

On 9/29/26 3:32 AM, Chen Yu wrote:
> On Mon, Sep 28, 2026 at 02:37:45PM -0700, Reinette Chatre wrote:
>> On 9/17/26 9:49 PM, Chen Yu wrote:


>>
>>   x86/resctrl: Parse ACPI ERDT table and build per-RMD CPU masks
>>
>>   Enhanced RDT (ERDT) exposes per-domain MMIO registers that resctrl needs
>>   in order to read hardware monitoring counters on the upcoming MMIO-based
>>   path. The kernel discovers this hardware through a single per-platform
>>   ERDT ACPI table.
>>
>>   Each Resource Management Domain Description (RMDD) sub-table within the
>>   ERDT table carries the MMIO base of one resource management domain (RMD) and,
>>   when RMDD_FLAG_CPU_L3_DOMAIN is set, identifies the domain as a CPU-scoped
>>   L3 monitoring domain. The set of CPUs in the domain is listed by x2APIC ID
> 
> 
> Maybe remove "monitoring" since RMDD is for a CPU mask, not specific to whether
> the mask is a monitor or control domain.

Sure.

> 
>>   in a nested CPU Agent Collection Description (CACD) sub-table.
>>
>>   Walk the ERDT table's RMDD sub-tables in preparation for attaching each
>>   ERDT domain to a resctrl L3 monitoring domain. For each CPU-based L3 RMDD,
>>   ioremap its control-register region, walk its nested CACD entries,
>>   translate each x2APIC ID to a logical CPU, and record the result on the
>>   ERDT domain's erdt_domain_info. Record the largest RMID that is valid
> 
> I think it is the minimum of the largest RMIDs exposed by each RMD.

This sounds the same to me? Your suggestion is closer to the math and code
while "largest RMID that is valid on every RMD"(*) describes what it actually
means? Having the changelog describe the changes and goals at high level makes
it easier to understand the low level details/code found in the patch.

(*) I just noticed the incorrect use of RMDD vs RMD in my example, highligthing
    that it should not just be copy&pasted.

> 
>>   on every RMDD so a later reader cannot access an RMID that is
>>   unsupported on some domain, and require every RMDD to advertise the
>>   same set of sub-table types so downstream code can rely on a uniform
>>   shape.
>>

...

>>> +			    struct erdt_domain_info *domain_info)
>>> +{
>>> +	struct acpi_erdt_cacd *cacd = (struct acpi_erdt_cacd *)subtbl;
>>> +	unsigned int num_ids;
>>> +	int cpu;
>>> +
>>> +	if (cacd->header.length < struct_size(cacd, X2APICIDS, 1)) {
>>> +		pr_warn(FW_BUG "Invalid x2apicid CACD table\n");
>>> +		return -EIO;
>>> +	}
>>> +
>>> +	num_ids = (cacd->header.length - sizeof(*cacd)) / sizeof(cacd->X2APICIDS[0]);
>>> +
>>> +	for (unsigned int i = 0; i < num_ids; i++) {
>>> +		cpu = topo_lookup_cpuid(cacd->X2APICIDS[i]);
>>> +		if (cpu < 0) {
>>> +			pr_warn(FW_BUG "Unknown x2apicid 0x%x\n", cacd->X2APICIDS[i]);
>>> +			return -EIO;
>>
>> The Sashiko reported issue looks real to me:
>> https://sashiko.dev/#/patchset/cover.1789705667.git.yu.c.chen%40intel.com?part=3
>>
>> Were you able to try the example where system limits the number of processors
>> via maxcpus= and see if ERDT still works?
>>
> 
> Yes, this is a valid case, but maxcpus= should be replaced by nr_cpus=.
> maxcpus= limits the online CPUs during bootup, and after bootup, those
> offline CPUs can still be queried by topo_lookup_cpuid(). While for
> nr_cpus=, those offline CPUs are not in the possible CPU mask, they can
> not be online after bootup, and they can not be found by

ah - thank you for pointing this out.

> topo_lookup_cpuid() either. If there is an inconsistency between the
> possible_cpus_mask and the CPU x2APIC set exposed by CACD, all ERDTs will
> be disabled. This is too strong. Let me skip this CPU if it cannot be found
> in the possible CPU mask.
>  
Reinette


  reply	other threads:[~2026-09-29 15:43 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-18  4:46 [PATCH v8 0/9] Introduce MMIO-based CMT access for Enhanced RDT Chen Yu
2026-09-18  4:48 ` [PATCH v8 1/9] x86/topology: Export topo_lookup_cpuid() for resctrl use Chen Yu
2026-09-18  4:48 ` [PATCH v8 2/9] x86/resctrl: Require 64-bit x86 for resctrl support Chen Yu
2026-09-28 21:21   ` Reinette Chatre
2026-09-29 15:03     ` Chen Yu
2026-09-18  4:49 ` [PATCH v8 3/9] x86/resctrl: Parse ACPI ERDT table and save CACD cpumask for RMDD domains Chen Yu
2026-09-28 21:37   ` Reinette Chatre
2026-09-29 10:32     ` Chen Yu
2026-09-29 15:40       ` Reinette Chatre [this message]
2026-09-18  4:50 ` [PATCH v8 4/9] x86/resctrl: Attach ACPI ERDT information to L3 mon domain on CPU online Chen Yu
2026-09-28 21:44   ` Reinette Chatre
2026-09-29 14:52     ` Chen Yu
2026-09-18  4:50 ` [PATCH v8 5/9] x86/resctrl: Parse ACPI CMRC table Chen Yu
2026-09-28 21:46   ` Reinette Chatre
2026-10-04  4:34     ` Chen Yu
2026-09-18  4:50 ` [PATCH v8 6/9] x86/resctrl: Refactor the monitor read function Chen Yu
2026-09-18  4:50 ` [PATCH v8 7/9] fs/resctrl: Do not invoke smp_processor_id() in preemptible context Chen Yu
2026-09-28 21:48   ` Reinette Chatre
2026-10-04  5:54     ` Chen Yu
2026-09-18  4:51 ` [PATCH v8 8/9] x86/resctrl: Introduce erdt_cpu_has() and erdt_support() Chen Yu
2026-09-28 21:49   ` Reinette Chatre
2026-10-06  8:28     ` Chen Yu
2026-09-18  4:51 ` [PATCH v8 9/9] x86/resctrl: Add MMIO-based LLC occupancy monitoring support Chen Yu
2026-09-28 21:54   ` Reinette Chatre
2026-10-08  7:00     ` Chen Yu
2026-10-08 15:52       ` Reinette Chatre
2026-10-09  6:01         ` Chen Yu

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=1d3e429d-fcae-4d60-b107-81128e611993@intel.com \
    --to=reinette.chatre@intel.com \
    --cc=babu.moger@amd.com \
    --cc=bp@alien8.de \
    --cc=chen.yu@linux.dev \
    --cc=dave.hansen@linux.intel.com \
    --cc=fenghuay@nvidia.com \
    --cc=hongyu.ning@intel.com \
    --cc=hongyu.ning@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@kernel.org \
    --cc=tony.luck@intel.com \
    --cc=x86@kernel.org \
    --cc=yu.c.chen@intel.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®