hc
2023-12-08 01573e231f18eb2d99162747186f59511f56b64d
kernel/include/linux/stop_machine.h
....@@ -24,20 +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;
29
- /* Did not run due to disabled stopper; for nowait debug checks */
30
- bool disabled;
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 */
3140 };
3241
3342 int stop_one_cpu(unsigned int cpu, cpu_stop_fn_t fn, void *arg);
3443 int stop_two_cpus(unsigned int cpu1, unsigned int cpu2, cpu_stop_fn_t fn, void *arg);
3544 bool stop_one_cpu_nowait(unsigned int cpu, cpu_stop_fn_t fn, void *arg,
3645 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);
3946 void stop_machine_park(int cpu);
4047 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);
4155
4256 #else /* CONFIG_SMP */
4357
....@@ -83,19 +97,7 @@
8397 return false;
8498 }
8599
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);
98
-}
100
+static inline void print_stop_info(const char *log_lvl, struct task_struct *task) { }
99101
100102 #endif /* CONFIG_SMP */
101103