From: Cheng Jian <cj.chengjian@huawei.com>
To: <mingo@redhat.com>, <peterz@infradead.org>, <akpm@linux-foundation.org>
Cc: <linux-kernel@vger.kernel.org>, <xiexiuqi@huawei.com>,
<huawei.libin@huawei.com>, <cj.chengjian@huawei.com>
Subject: [PATCH] sched/core: Remove unnecessary initialization init_idle_bootup_task()
Date: Fri, 4 Aug 2017 17:19:37 +0800 [thread overview]
Message-ID: <1501838377-109720-1-git-send-email-cj.chengjian@huawei.com> (raw)
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 set :
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>
---
include/linux/sched/task.h | 1 -
init/main.c | 1 -
kernel/sched/core.c | 5 -----
3 files changed, 7 deletions(-)
diff --git a/include/linux/sched/task.h b/include/linux/sched/task.h
index c97e5f0..79a2a74 100644
--- a/include/linux/sched/task.h
+++ b/include/linux/sched/task.h
@@ -30,7 +30,6 @@
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);
diff --git a/init/main.c b/init/main.c
index 052481f..881d624 100644
--- a/init/main.c
+++ b/init/main.c
@@ -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);
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 0869b20..7377cac 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -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
--
1.8.3.1
next reply other threads:[~2017-08-04 9:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-04 9:19 Cheng Jian [this message]
2017-08-04 9:43 ` [PATCH] sched/core: Remove unnecessary initialization init_idle_bootup_task() Peter Zijlstra
2017-08-10 12:09 ` [tip:sched/core] " tip-bot for Cheng Jian
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1501838377-109720-1-git-send-email-cj.chengjian@huawei.com \
--to=cj.chengjian@huawei.com \
--cc=akpm@linux-foundation.org \
--cc=huawei.libin@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=xiexiuqi@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.