.. | .. |
---|
24 | 24 | struct cpu_stop_work { |
---|
25 | 25 | struct list_head list; /* cpu_stopper->works */ |
---|
26 | 26 | cpu_stop_fn_t fn; |
---|
| 27 | + unsigned long caller; |
---|
27 | 28 | void *arg; |
---|
28 | 29 | 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 */ |
---|
29 | 40 | }; |
---|
30 | 41 | |
---|
31 | 42 | int stop_one_cpu(unsigned int cpu, cpu_stop_fn_t fn, void *arg); |
---|
32 | 43 | int stop_two_cpus(unsigned int cpu1, unsigned int cpu2, cpu_stop_fn_t fn, void *arg); |
---|
33 | 44 | bool stop_one_cpu_nowait(unsigned int cpu, cpu_stop_fn_t fn, void *arg, |
---|
34 | 45 | 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); |
---|
37 | 46 | void stop_machine_park(int cpu); |
---|
38 | 47 | 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); |
---|
39 | 55 | |
---|
40 | 56 | #else /* CONFIG_SMP */ |
---|
41 | 57 | |
---|
.. | .. |
---|
81 | 97 | return false; |
---|
82 | 98 | } |
---|
83 | 99 | |
---|
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) { } |
---|
97 | 101 | |
---|
98 | 102 | #endif /* CONFIG_SMP */ |
---|
99 | 103 | |
---|