Re: [PATCH 1/4] ACPI / PPTT: Add a helper to fill a cpumask from a processor container

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Sudeep,

On 23/06/2025 14:08, Sudeep Holla wrote:
> On Thu, Jun 12, 2025 at 05:13:33PM +0000, James Morse wrote:
>> The PPTT describes CPUs and caches, as well as processor containers.
>> The ACPI table for MPAM describes the set of CPUs that can access an MSC
>> with the UID of a processor container.
>>
>> Add a helper to find the processor container by its id, then walk
>> the possible CPUs to fill a cpumask with the CPUs that have this
>> processor container as a parent.

>> diff --git a/drivers/acpi/pptt.c b/drivers/acpi/pptt.c
>> index 54676e3d82dd..aaf9b5a26d07 100644
>> --- a/drivers/acpi/pptt.c
>> +++ b/drivers/acpi/pptt.c
>> @@ -298,6 +298,97 @@ static struct acpi_pptt_processor *acpi_find_processor_node(struct acpi_table_he
>>  	return NULL;
>>  }
>>  
>> +/**
>> + * acpi_pptt_get_child_cpus() - Find all the CPUs below a PPTT processor node
>> + * @table_hdr:		A reference to the PPTT table.
>> + * @parent_node:	A pointer to the processor node in the @table_hdr.
>> + * @cpus:		A cpumask to fill with the CPUs below @parent_node.
>> + *

> Is this cpus mask always cleared before acpi_pptt_get_child_cpus() is called.
> Just checking if it makes sense to clear it before we start the loop in this
> function or do we have a need to start with a pre-filled cpumask ?

It's only got one caller, which does the cpumask_clear() - but I've been bitten by this,
so getting them both to do it would be least surprising.


> Other than that, LGTM.
> 
> Reviewed-by: Sudeep Holla <sudeep.holla@xxxxxxx>


Thanks!

James




[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]
  Powered by Linux