Skip to content
Snippets Groups Projects

Draft: Add stop_housekeeping_cpuslocked()

Open Costa Shulyupin requested to merge makelinux/centos-stream-10:my-centos-stream-10 into main
1 file
+ 11
3
Compare changes
  • Side-by-side
  • Inline
+ 11
3
@@ -680,8 +680,12 @@ int stop_machine_from_inactive_cpu(cpu_stop_fn_t fn, void *data,
struct multi_stop_data msdata = { .fn = fn, .data = data,
.active_cpus = cpus };
struct cpu_stop_done done;
cpumask_var_t stop_cpus;
int ret;
if (!alloc_cpumask_var(&stop_cpus, GFP_KERNEL))
return -ENOMEM;
/* Local CPU must be inactive and CPU hotplug in progress. */
BUG_ON(cpu_active(raw_smp_processor_id()));
msdata.num_threads = num_active_cpus() + 1; /* +1 for local */
@@ -692,9 +696,12 @@ int stop_machine_from_inactive_cpu(cpu_stop_fn_t fn, void *data,
/* Schedule work on other CPUs and execute directly for local CPU */
set_state(&msdata, MULTI_STOP_PREPARE);
cpu_stop_init_done(&done, num_active_cpus());
queue_stop_cpus_work(cpu_active_mask, multi_cpu_stop, &msdata,
&done);
/*
* don't stop isolated CPUs
*/
cpumask_and(stop_cpus, housekeeping_cpumask(HK_TYPE_MANAGED_IRQ), cpu_active_mask);
cpu_stop_init_done(&done, cpumask_weight(stop_cpus));
queue_stop_cpus_work(stop_cpus, multi_cpu_stop, &msdata, &done);
ret = multi_cpu_stop(&msdata);
/* Busy wait for completion. */
@@ -702,5 +709,6 @@ int stop_machine_from_inactive_cpu(cpu_stop_fn_t fn, void *data,
cpu_relax();
mutex_unlock(&stop_cpus_mutex);
free_cpumask_var(stop_cpus);
return ret ?: done.ret;
}
Loading