When !CONFIG_SMP, cpu_stop functions weren't defined at all which could lead to build failures if UP code uses cpu_stop facility. Add dummy cpu_stop implementation for UP. The waiting variants execute the work function directly with preempt disabled and stop_one_cpu_nowait() schedules a workqueue work. Makefile and ifdefs around stop_machine implementation are updated to accomodate CONFIG_SMP && !CONFIG_STOP_MACHINE case.
Showing the changes to kernel/stop_machine.c (1 of 3 files). Show all
Unified · Split
| @@ -375,6 +375,8 @@ static int __init cpu_stop_init(void) · 374 unmodified lines | |||
| 375 | } | 375 | } |
| 376 | early_initcall(cpu_stop_init); | 376 | early_initcall(cpu_stop_init); |
| 377 | 377 | ||
| 378 | #ifdef CONFIG_STOP_MACHINE | ||
| 379 | |||
| 378 | /* This controls the threads on each CPU. */ | 380 | /* This controls the threads on each CPU. */ |
| 379 | enum stopmachine_state { | 381 | enum stopmachine_state { |
| 380 | /* Dummy starting state for thread. */ | 382 | /* Dummy starting state for thread. */ |
| @@ -477,3 +479,5 @@ int stop_machine(int (*fn)(void *), void *data, const struct cpumask *cpus) · 96 unmodified lines | |||
| 477 | return ret; | 479 | return ret; |
| 478 | } | 480 | } |
| 479 | EXPORT_SYMBOL_GPL(stop_machine); | 481 | EXPORT_SYMBOL_GPL(stop_machine); |
| 482 | |||
| 483 | #endif /* CONFIG_STOP_MACHINE */ | ||