Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1348046

[PATCH 1/2] cpu, idle: move init_idle() out of idle_thread_get()

From Andrey Ryabinin <aryabinin@virtuozzo.com>
Newsgroups linux.kernel
Subject [PATCH 1/2] cpu, idle: move init_idle() out of idle_thread_get()
Date 2016-03-02 15:00 +0100
Message-ID <r8ftN-8on-21@gated-at.bofh.it> (permalink)
References <r8exI-7Hb-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v1] kasan, arm64: Unpoison dirty stack frames when resuming from suspend. Alexander Potapenko <glider@google.com> - 2016-02-26 13:40 +0100
  Re: [PATCH v1] kasan, arm64: Unpoison dirty stack frames when  resuming from suspend. Mark Rutland <mark.rutland@arm.com> - 2016-02-26 15:00 +0100
    Re: [PATCH v1] kasan, arm64: Unpoison dirty stack frames when  resuming from suspend. Alexander Potapenko <glider@google.com> - 2016-02-26 18:30 +0100
      Re: [PATCH v1] kasan, arm64: Unpoison dirty stack frames when  resuming from suspend. Mark Rutland <mark.rutland@arm.com> - 2016-03-01 20:40 +0100
      Re: [PATCH v1] kasan, arm64: Unpoison dirty stack frames when  resuming from suspend. Mark Rutland <mark.rutland@arm.com> - 2016-03-01 20:50 +0100
        Re: [PATCH v1] kasan, arm64: Unpoison dirty stack frames when  resuming from suspend. Andrey Ryabinin <ryabinin.a.a@gmail.com> - 2016-03-02 14:00 +0100
          [PATCH 1/2] cpu, idle: move init_idle() out of idle_thread_get() Andrey Ryabinin <aryabinin@virtuozzo.com> - 2016-03-02 15:00 +0100
            [PATCH 2/2] kasan: unpoison stack of idle task on cpu online Andrey Ryabinin <aryabinin@virtuozzo.com> - 2016-03-02 15:00 +0100
              Re: [PATCH 2/2] kasan: unpoison stack of idle task on cpu online Mark Rutland <mark.rutland@arm.com> - 2016-03-02 16:00 +0100
                Re: [PATCH 2/2] kasan: unpoison stack of idle task on cpu online Andrey Ryabinin <aryabinin@virtuozzo.com> - 2016-03-02 16:30 +0100
                Re: [PATCH 2/2] kasan: unpoison stack of idle task on cpu online Mark Rutland <mark.rutland@arm.com> - 2016-03-02 16:50 +0100

csiph-web