Messages in this thread Patch in this message | | | From | Andrey Ryabinin <> | Subject | [PATCH 1/2] cpu, idle: move init_idle() out of idle_thread_get() | Date | Wed, 2 Mar 2016 16:51:58 +0300 |
| |
Currently idle_thread_get() not only gets the idle task but also initializes it. This is fine for _cpu_up() which is the only caller of idle_thread_get().
idle_thread_get() is going to be used in the next patch, but it would be nice to avoid double initialization of idle task. Hence this patch removes init_idle() call from idle_thread_get() and invokes it directly from _cpu_up().
No functional changes here.
Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com> --- kernel/cpu.c | 2 ++ kernel/smpboot.c | 1 - 2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/kernel/cpu.c b/kernel/cpu.c index 5b9d396..63d8e7b 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c @@ -503,6 +503,8 @@ static int _cpu_up(unsigned int cpu, int tasks_frozen) goto out; } + init_idle(idle, cpu); + ret = smpboot_create_threads(cpu); if (ret) goto out; diff --git a/kernel/smpboot.c b/kernel/smpboot.c index d264f59..74687e8 100644 --- a/kernel/smpboot.c +++ b/kernel/smpboot.c @@ -31,7 +31,6 @@ struct task_struct *idle_thread_get(unsigned int cpu) if (!tsk) return ERR_PTR(-ENOMEM); - init_idle(tsk, cpu); return tsk; } -- 2.4.10
| |