From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752754AbcCBNwo (ORCPT ); Wed, 2 Mar 2016 08:52:44 -0500 Received: from mx2.parallels.com ([199.115.105.18]:38894 "EHLO mx2.parallels.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752396AbcCBNwm (ORCPT ); Wed, 2 Mar 2016 08:52:42 -0500 From: Andrey Ryabinin To: CC: Mark Rutland , Alexander Potapenko , Andrey Konovalov , Dmitriy Vyukov , , , Andrew Morton , , Ingo Molnar , Peter Zijlstra , Thomas Gleixner , 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 Message-ID: <1456926719-13102-1-git-send-email-aryabinin@virtuozzo.com> X-Mailer: git-send-email 2.4.10 In-Reply-To: <56D6E250.7070301@gmail.com> References: <56D6E250.7070301@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-ClientProxiedBy: US-EXCH.sw.swsoft.com (10.255.249.47) To US-EXCH2.sw.swsoft.com (10.255.249.46) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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