diff options
author | Cheng Jian <cj.chengjian@huawei.com> | 2017-08-04 05:19:37 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2017-08-10 06:18:18 -0400 |
commit | 18f08dae19990f5fffde92e3a63e0d90cda0f1a8 (patch) | |
tree | 541e061023393f4b24ae0a9a490258319a62c984 | |
parent | 3261ed0b25098f92d36d5ad14524254d8c7fba54 (diff) |
sched/core: Remove unnecessary initialization init_idle_bootup_task()
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>
-rw-r--r-- | include/linux/sched/task.h | 1 | ||||
-rw-r--r-- | init/main.c | 1 | ||||
-rw-r--r-- | kernel/sched/core.c | 5 |
3 files changed, 0 insertions, 7 deletions
diff --git a/include/linux/sched/task.h b/include/linux/sched/task.h index c97e5f096927..79a2a744648d 100644 --- a/include/linux/sched/task.h +++ b/include/linux/sched/task.h | |||
@@ -30,7 +30,6 @@ extern int lockdep_tasklist_lock_is_held(void); | |||
30 | 30 | ||
31 | extern asmlinkage void schedule_tail(struct task_struct *prev); | 31 | extern asmlinkage void schedule_tail(struct task_struct *prev); |
32 | extern void init_idle(struct task_struct *idle, int cpu); | 32 | extern void init_idle(struct task_struct *idle, int cpu); |
33 | extern void init_idle_bootup_task(struct task_struct *idle); | ||
34 | 33 | ||
35 | extern int sched_fork(unsigned long clone_flags, struct task_struct *p); | 34 | extern int sched_fork(unsigned long clone_flags, struct task_struct *p); |
36 | extern void sched_dead(struct task_struct *p); | 35 | extern void sched_dead(struct task_struct *p); |
diff --git a/init/main.c b/init/main.c index 052481fbe363..881d62438b1a 100644 --- a/init/main.c +++ b/init/main.c | |||
@@ -430,7 +430,6 @@ static noinline void __ref rest_init(void) | |||
430 | * The boot idle thread must execute schedule() | 430 | * The boot idle thread must execute schedule() |
431 | * at least once to get things moving: | 431 | * at least once to get things moving: |
432 | */ | 432 | */ |
433 | init_idle_bootup_task(current); | ||
434 | schedule_preempt_disabled(); | 433 | schedule_preempt_disabled(); |
435 | /* Call into cpu_idle with preempt disabled */ | 434 | /* Call into cpu_idle with preempt disabled */ |
436 | cpu_startup_entry(CPUHP_ONLINE); | 435 | cpu_startup_entry(CPUHP_ONLINE); |
diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 835a234d35e8..6d91c10b1814 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c | |||
@@ -5177,11 +5177,6 @@ void show_state_filter(unsigned long state_filter) | |||
5177 | debug_show_all_locks(); | 5177 | debug_show_all_locks(); |
5178 | } | 5178 | } |
5179 | 5179 | ||
5180 | void init_idle_bootup_task(struct task_struct *idle) | ||
5181 | { | ||
5182 | idle->sched_class = &idle_sched_class; | ||
5183 | } | ||
5184 | |||
5185 | /** | 5180 | /** |
5186 | * init_idle - set up an idle thread for a given CPU | 5181 | * init_idle - set up an idle thread for a given CPU |
5187 | * @idle: task in question | 5182 | * @idle: task in question |