History

cpu_stop: add dummy implementation for UP

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.

Tejun Heo committed 16 years ago

Commit bbf1bb31 parent fc390cd3 files · +68 −7Browse files

Showing the changes to kernel/stop_machine.c (1 of 3 files). Show all

Unified · Split

kernel/stop_machine.c+4−0
@@ -375,6 +375,8 @@ static int __init cpu_stop_init(void) · 374 unmodified lines
375375 }
376376 early_initcall(cpu_stop_init);
377377
378+#ifdef CONFIG_STOP_MACHINE
379+
378380 /* This controls the threads on each CPU. */
379381 enum stopmachine_state {
380382 /* Dummy starting state for thread. */
@@ -477,3 +479,5 @@ int stop_machine(int (*fn)(void *), void *data, const struct cpumask *cpus) · 96 unmodified lines
477479 return ret;
478480 }
479481 EXPORT_SYMBOL_GPL(stop_machine);
482+
483+#endif /* CONFIG_STOP_MACHINE */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t