bpf: Use c->unit_size to select target cache during free
[platform/kernel/linux-starfive.git] / kernel / cpu.c
index 1a189da..72e0f53 100644 (file)
@@ -1523,11 +1523,14 @@ static int cpu_down_maps_locked(unsigned int cpu, enum cpuhp_state target)
        /*
         * Ensure that the control task does not run on the to be offlined
         * CPU to prevent a deadlock against cfs_b->period_timer.
+        * Also keep at least one housekeeping cpu onlined to avoid generating
+        * an empty sched_domain span.
         */
-       cpu = cpumask_any_but(cpu_online_mask, cpu);
-       if (cpu >= nr_cpu_ids)
-               return -EBUSY;
-       return work_on_cpu(cpu, __cpu_down_maps_locked, &work);
+       for_each_cpu_and(cpu, cpu_online_mask, housekeeping_cpumask(HK_TYPE_DOMAIN)) {
+               if (cpu != work.cpu)
+                       return work_on_cpu(cpu, __cpu_down_maps_locked, &work);
+       }
+       return -EBUSY;
 }
 
 static int cpu_down(unsigned int cpu, enum cpuhp_state target)
@@ -2106,7 +2109,7 @@ static struct cpuhp_step cpuhp_hp_states[] = {
        [CPUHP_HRTIMERS_PREPARE] = {
                .name                   = "hrtimers:prepare",
                .startup.single         = hrtimers_prepare_cpu,
-               .teardown.single        = hrtimers_dead_cpu,
+               .teardown.single        = NULL,
        },
        [CPUHP_SMPCFD_PREPARE] = {
                .name                   = "smpcfd:prepare",
@@ -2198,6 +2201,12 @@ static struct cpuhp_step cpuhp_hp_states[] = {
                .startup.single         = NULL,
                .teardown.single        = smpcfd_dying_cpu,
        },
+       [CPUHP_AP_HRTIMERS_DYING] = {
+               .name                   = "hrtimers:dying",
+               .startup.single         = NULL,
+               .teardown.single        = hrtimers_cpu_dying,
+       },
+
        /* Entry state on starting. Interrupts enabled from here on. Transient
         * state for synchronsization */
        [CPUHP_AP_ONLINE] = {