hc
2023-12-08 01573e231f18eb2d99162747186f59511f56b64d
kernel/include/linux/stop_machine.h
....@@ -24,18 +24,34 @@
2424 struct cpu_stop_work {
2525 struct list_head list; /* cpu_stopper->works */
2626 cpu_stop_fn_t fn;
27
+ unsigned long caller;
2728 void *arg;
2829 struct cpu_stop_done *done;
30
+};
31
+
32
+/*
33
+ * Structure to determine completion condition and record errors. May
34
+ * be shared by works on different cpus.
35
+ */
36
+struct cpu_stop_done {
37
+ atomic_t nr_todo; /* nr left to execute */
38
+ int ret; /* collected return value */
39
+ struct completion completion; /* fired if nr_todo reaches 0 */
2940 };
3041
3142 int stop_one_cpu(unsigned int cpu, cpu_stop_fn_t fn, void *arg);
3243 int stop_two_cpus(unsigned int cpu1, unsigned int cpu2, cpu_stop_fn_t fn, void *arg);
3344 bool stop_one_cpu_nowait(unsigned int cpu, cpu_stop_fn_t fn, void *arg,
3445 struct cpu_stop_work *work_buf);
35
-int stop_cpus(const struct cpumask *cpumask, cpu_stop_fn_t fn, void *arg);
36
-int try_stop_cpus(const struct cpumask *cpumask, cpu_stop_fn_t fn, void *arg);
3746 void stop_machine_park(int cpu);
3847 void stop_machine_unpark(int cpu);
48
+void stop_machine_yield(const struct cpumask *cpumask);
49
+int stop_one_cpu_async(unsigned int cpu, cpu_stop_fn_t fn, void *arg,
50
+ struct cpu_stop_work *work_buf,
51
+ struct cpu_stop_done *done);
52
+void cpu_stop_work_wait(struct cpu_stop_work *work_buf);
53
+
54
+extern void print_stop_info(const char *log_lvl, struct task_struct *task);
3955
4056 #else /* CONFIG_SMP */
4157
....@@ -81,19 +97,7 @@
8197 return false;
8298 }
8399
84
-static inline int stop_cpus(const struct cpumask *cpumask,
85
- cpu_stop_fn_t fn, void *arg)
86
-{
87
- if (cpumask_test_cpu(raw_smp_processor_id(), cpumask))
88
- return stop_one_cpu(raw_smp_processor_id(), fn, arg);
89
- return -ENOENT;
90
-}
91
-
92
-static inline int try_stop_cpus(const struct cpumask *cpumask,
93
- cpu_stop_fn_t fn, void *arg)
94
-{
95
- return stop_cpus(cpumask, fn, arg);
96
-}
100
+static inline void print_stop_info(const char *log_lvl, struct task_struct *task) { }
97101
98102 #endif /* CONFIG_SMP */
99103