diff options
Diffstat (limited to 'kernel/smpboot.c')
| -rw-r--r-- | kernel/smpboot.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/kernel/smpboot.c b/kernel/smpboot.c index e1a797e028a3..98f60c5caa1b 100644 --- a/kernel/smpboot.c +++ b/kernel/smpboot.c | |||
| @@ -31,6 +31,12 @@ void __init idle_thread_set_boot_cpu(void) | |||
| 31 | per_cpu(idle_threads, smp_processor_id()) = current; | 31 | per_cpu(idle_threads, smp_processor_id()) = current; |
| 32 | } | 32 | } |
| 33 | 33 | ||
| 34 | /** | ||
| 35 | * idle_init - Initialize the idle thread for a cpu | ||
| 36 | * @cpu: The cpu for which the idle thread should be initialized | ||
| 37 | * | ||
| 38 | * Creates the thread if it does not exist. | ||
| 39 | */ | ||
| 34 | static inline void idle_init(unsigned int cpu) | 40 | static inline void idle_init(unsigned int cpu) |
| 35 | { | 41 | { |
| 36 | struct task_struct *tsk = per_cpu(idle_threads, cpu); | 42 | struct task_struct *tsk = per_cpu(idle_threads, cpu); |
| @@ -45,17 +51,16 @@ static inline void idle_init(unsigned int cpu) | |||
| 45 | } | 51 | } |
| 46 | 52 | ||
| 47 | /** | 53 | /** |
| 48 | * idle_thread_init - Initialize the idle thread for a cpu | 54 | * idle_threads_init - Initialize idle threads for all cpus |
| 49 | * @cpu: The cpu for which the idle thread should be initialized | ||
| 50 | * | ||
| 51 | * Creates the thread if it does not exist. | ||
| 52 | */ | 55 | */ |
| 53 | void __init idle_threads_init(void) | 56 | void __init idle_threads_init(void) |
| 54 | { | 57 | { |
| 55 | unsigned int cpu; | 58 | unsigned int cpu, boot_cpu; |
| 59 | |||
| 60 | boot_cpu = smp_processor_id(); | ||
| 56 | 61 | ||
| 57 | for_each_possible_cpu(cpu) { | 62 | for_each_possible_cpu(cpu) { |
| 58 | if (cpu != smp_processor_id()) | 63 | if (cpu != boot_cpu) |
| 59 | idle_init(cpu); | 64 | idle_init(cpu); |
| 60 | } | 65 | } |
| 61 | } | 66 | } |
