hc
2023-12-11 6778948f9de86c3cfaf36725a7c87dcff9ba247f
kernel/kernel/stop_machine.c
....@@ -33,26 +33,10 @@
3333 struct list_head works; /* list of pending works */
3434
3535 struct cpu_stop_work stop_work; /* for stop_cpus */
36
- unsigned long caller;
37
- cpu_stop_fn_t fn;
3836 };
3937
4038 static DEFINE_PER_CPU(struct cpu_stopper, cpu_stopper);
4139 static bool stop_machine_initialized = false;
42
-
43
-void print_stop_info(const char *log_lvl, struct task_struct *task)
44
-{
45
- /*
46
- * If @task is a stopper task, it cannot migrate and task_cpu() is
47
- * stable.
48
- */
49
- struct cpu_stopper *stopper = per_cpu_ptr(&cpu_stopper, task_cpu(task));
50
-
51
- if (task != stopper->thread)
52
- return;
53
-
54
- printk("%sStopper: %pS <- %pS\n", log_lvl, stopper->fn, (void *)stopper->caller);
55
-}
5640
5741 /* static data for stop_cpus */
5842 static DEFINE_MUTEX(stop_cpus_mutex);
....@@ -130,7 +114,7 @@
130114 int stop_one_cpu(unsigned int cpu, cpu_stop_fn_t fn, void *arg)
131115 {
132116 struct cpu_stop_done done;
133
- struct cpu_stop_work work = { .fn = fn, .arg = arg, .done = &done, .caller = _RET_IP_ };
117
+ struct cpu_stop_work work = { .fn = fn, .arg = arg, .done = &done };
134118
135119 cpu_stop_init_done(&done, 1);
136120 if (!cpu_stop_queue_work(cpu, &work))
....@@ -338,8 +322,7 @@
338322 work1 = work2 = (struct cpu_stop_work){
339323 .fn = multi_cpu_stop,
340324 .arg = &msdata,
341
- .done = &done,
342
- .caller = _RET_IP_,
325
+ .done = &done
343326 };
344327
345328 cpu_stop_init_done(&done, 2);
....@@ -375,7 +358,7 @@
375358 bool stop_one_cpu_nowait(unsigned int cpu, cpu_stop_fn_t fn, void *arg,
376359 struct cpu_stop_work *work_buf)
377360 {
378
- *work_buf = (struct cpu_stop_work){ .fn = fn, .arg = arg, .caller = _RET_IP_, };
361
+ *work_buf = (struct cpu_stop_work){ .fn = fn, .arg = arg, };
379362 return cpu_stop_queue_work(cpu, work_buf);
380363 }
381364 EXPORT_SYMBOL_GPL(stop_one_cpu_nowait);
....@@ -544,8 +527,6 @@
544527 int ret;
545528
546529 /* cpu stop callbacks must not sleep, make in_atomic() == T */
547
- stopper->caller = work->caller;
548
- stopper->fn = fn;
549530 preempt_count_inc();
550531 ret = fn(arg);
551532 if (done) {
....@@ -554,8 +535,6 @@
554535 cpu_stop_signal_done(done);
555536 }
556537 preempt_count_dec();
557
- stopper->fn = NULL;
558
- stopper->caller = 0;
559538 WARN_ONCE(preempt_count(),
560539 "cpu_stop: %ps(%p) leaked preempt count\n", fn, arg);
561540 goto repeat;