hc
2023-12-11 6778948f9de86c3cfaf36725a7c87dcff9ba247f
kernel/include/linux/stop_machine.h
....@@ -26,18 +26,29 @@
2626 cpu_stop_fn_t fn;
2727 void *arg;
2828 struct cpu_stop_done *done;
29
- /* Did not run due to disabled stopper; for nowait debug checks */
30
- bool disabled;
29
+};
30
+
31
+/*
32
+ * Structure to determine completion condition and record errors. May
33
+ * be shared by works on different cpus.
34
+ */
35
+struct cpu_stop_done {
36
+ atomic_t nr_todo; /* nr left to execute */
37
+ int ret; /* collected return value */
38
+ struct completion completion; /* fired if nr_todo reaches 0 */
3139 };
3240
3341 int stop_one_cpu(unsigned int cpu, cpu_stop_fn_t fn, void *arg);
3442 int stop_two_cpus(unsigned int cpu1, unsigned int cpu2, cpu_stop_fn_t fn, void *arg);
3543 bool stop_one_cpu_nowait(unsigned int cpu, cpu_stop_fn_t fn, void *arg,
3644 struct cpu_stop_work *work_buf);
37
-int stop_cpus(const struct cpumask *cpumask, cpu_stop_fn_t fn, void *arg);
38
-int try_stop_cpus(const struct cpumask *cpumask, cpu_stop_fn_t fn, void *arg);
3945 void stop_machine_park(int cpu);
4046 void stop_machine_unpark(int cpu);
47
+void stop_machine_yield(const struct cpumask *cpumask);
48
+int stop_one_cpu_async(unsigned int cpu, cpu_stop_fn_t fn, void *arg,
49
+ struct cpu_stop_work *work_buf,
50
+ struct cpu_stop_done *done);
51
+void cpu_stop_work_wait(struct cpu_stop_work *work_buf);
4152
4253 #else /* CONFIG_SMP */
4354
....@@ -81,20 +92,6 @@
8192 }
8293
8394 return false;
84
-}
85
-
86
-static inline int stop_cpus(const struct cpumask *cpumask,
87
- cpu_stop_fn_t fn, void *arg)
88
-{
89
- if (cpumask_test_cpu(raw_smp_processor_id(), cpumask))
90
- return stop_one_cpu(raw_smp_processor_id(), fn, arg);
91
- return -ENOENT;
92
-}
93
-
94
-static inline int try_stop_cpus(const struct cpumask *cpumask,
95
- cpu_stop_fn_t fn, void *arg)
96
-{
97
- return stop_cpus(cpumask, fn, arg);
9895 }
9996
10097 #endif /* CONFIG_SMP */