[RFC PATCH 4/5] powerpc/smp: Factor out assign_threads()

Michael Ellerman mpe at ellerman.id.au
Thu Feb 15 00:10:22 AEDT 2024


Aneesh Kumar K.V <aneesh.kumar at kernel.org> writes:
> Michael Ellerman <mpe at ellerman.id.au> writes:
>
> ....
>   
>> +static int assign_threads(unsigned cpu, unsigned int nthreads, bool avail,
>>
>
> May be rename 'avail' to 'present'

Yeah, will do.

cheers

>> +                          const __be32 *hw_ids)
>> +{
>> +	for (int i = 0; i < nthreads && cpu < nr_cpu_ids; i++) {
>> +		__be32 hwid;
>> +
>> +		hwid = be32_to_cpu(hw_ids[i]);
>> +
>> +		DBG("    thread %d -> cpu %d (hard id %d)\n", i, cpu, hwid);
>> +
>> +		set_cpu_present(cpu, avail);
>> +		set_cpu_possible(cpu, true);
>> +		cpu_to_phys_id[cpu] = hwid;
>> +		cpu++;
>> +	}
>> +
>
> -aneesh


More information about the Linuxppc-dev mailing list