sched/core: Remove unnecessary initialization init_idle_bootup_task()
authorCheng Jian <cj.chengjian@huawei.com>
Fri, 4 Aug 2017 09:19:37 +0000 (17:19 +0800)
committerIngo Molnar <mingo@kernel.org>
Thu, 10 Aug 2017 10:18:18 +0000 (12:18 +0200)
init_idle_bootup_task( ) is called in rest_init( ) to switch
the scheduling class of the boot thread to the idle class.

the function only sets:

    idle->sched_class = &idle_sched_class;

which has been set in init_idle() called by sched_init():

    /*
     * The idle tasks have their own, simple scheduling class:
     */
    idle->sched_class = &idle_sched_class;

We've already set the boot thread to idle class in
start_kernel()->sched_init()->init_idle()
so it's unnecessary to set it again in
start_kernel()->rest_init()->init_idle_bootup_task()

Signed-off-by: Cheng Jian <cj.chengjian@huawei.com>
Signed-off-by: Xie XiuQi <xiexiuqi@huawei.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: <akpm@linux-foundation.org>
Cc: <huawei.libin@huawei.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1501838377-109720-1-git-send-email-cj.chengjian@huawei.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
include/linux/sched/task.h
init/main.c
kernel/sched/core.c

index c97e5f09692768d0cf2a3770c45aacf2fdc8baf1..79a2a744648dd704b024cab1b37d85e4b2949ca0 100644 (file)
@@ -30,7 +30,6 @@ extern int lockdep_tasklist_lock_is_held(void);
 
 extern asmlinkage void schedule_tail(struct task_struct *prev);
 extern void init_idle(struct task_struct *idle, int cpu);
-extern void init_idle_bootup_task(struct task_struct *idle);
 
 extern int sched_fork(unsigned long clone_flags, struct task_struct *p);
 extern void sched_dead(struct task_struct *p);
index 052481fbe3633f64b420c5bbd6deea3be261e6a9..881d62438b1a79643ab6db8e4098569978f3469a 100644 (file)
@@ -430,7 +430,6 @@ static noinline void __ref rest_init(void)
         * The boot idle thread must execute schedule()
         * at least once to get things moving:
         */
-       init_idle_bootup_task(current);
        schedule_preempt_disabled();
        /* Call into cpu_idle with preempt disabled */
        cpu_startup_entry(CPUHP_ONLINE);
index 835a234d35e8db86862a2b4c47b34fc34d6e30d6..6d91c10b18144ba5fb1023847bd412b400d9719e 100644 (file)
@@ -5177,11 +5177,6 @@ void show_state_filter(unsigned long state_filter)
                debug_show_all_locks();
 }
 
-void init_idle_bootup_task(struct task_struct *idle)
-{
-       idle->sched_class = &idle_sched_class;
-}
-
 /**
  * init_idle - set up an idle thread for a given CPU
  * @idle: task in question