On Thu, Aug 25, 2022 at 09:01:17PM -0400, Waiman Long wrote:That is the reason why I have a fallback allocation in __set_cpus_allowed_ptr(). Thanks for the suggestion, I will looking into doing that.
@@ -9352,6 +9381,11 @@ int sched_cpu_activate(unsigned int cpu)this is too late; I think you'll have to add a sched_cpu_prepare() and
sched_update_numa(cpu, true);
sched_domains_numa_masks_set(cpu);
cpuset_cpu_active();
+ /*
+ * Preallocated scratch cpumask
+ */
+ if (!rq->scratch_mask)
+ rq->scratch_mask = kmalloc(cpumask_size(), GFP_KERNEL);
}
simply fail the cpu-up when the allocation fails.