Re: [RFC PATCH 4/5] powerpc/smp: Factor out assign_threads()
From: Michael Ellerman <mpe@ellerman.id.au>
Date: 2024-02-14 13:11:12
From: Michael Ellerman <mpe@ellerman.id.au>
Date: 2024-02-14 13:11:12
Aneesh Kumar K.V [off-list ref] writes:
Michael Ellerman [off-list ref] writes: ....quoted
+static int assign_threads(unsigned cpu, unsigned int nthreads, bool avail,May be rename 'avail' to 'present'
Yeah, will do. cheers
quoted
+ 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