Re: [RFC PATCH 1/6] x86/resctrl: Parse ACPI ERDT table and map RMDD domains by L3 cache ID

From: Luck, Tony

Date: Thu May 28 2026 - 16:30:49 EST


On Wed, May 27, 2026 at 05:26:54PM +0800, Chen Yu wrote:
> +static __init int get_l3_cache_id_from_cacd(struct acpi_erdt_cacd *cacd)
> +{
> + int num_ids, cpu, online_cpu = -1, cache_id = -1, tmp;
> + struct cacheinfo *ci;
> +
> + if (cacd->header.length < sizeof(*cacd) + sizeof(cacd->X2APICIDS[0])) {
> + pr_warn(FW_BUG "Invalid x2apicid CACD table\n");
> + return -1;
> + }
> +
> + num_ids = (cacd->header.length - sizeof(*cacd)) / sizeof(cacd->X2APICIDS[0]);
> +
> + guard(cpus_read_lock)();

This file should #include <linux/cleanup.h> (maybe some other headers
too) to follow the "include-what-you-use" best practice (which is only
lightly enforced in the kernel - but saves pain when some refactor
breaks your code because the implicit chain of includes is changed).

-Tony