Re: [RFC PATCH 4/5] powerpc/smp: Factor out assign_threads()
From: Aneesh Kumar K.V <aneesh.kumar@kernel.org>
Date: 2024-01-02 04:35:39
From: Aneesh Kumar K.V <aneesh.kumar@kernel.org>
Date: 2024-01-02 04:35:39
Michael Ellerman [off-list ref] writes: ....
+static int assign_threads(unsigned cpu, unsigned int nthreads, bool avail,
May be rename 'avail' to 'present'
+ 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