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


Groups > linux.kernel > #1703813 > unrolled thread

[PATCH] sched/core: Remove unnecessary initialization init_idle_bootup_task()

Started byCheng Jian <cj.chengjian@huawei.com>
First post2017-08-04 11:20 +0200
Last post2017-08-10 14:20 +0200
Articles 3 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] sched/core: Remove unnecessary initialization init_idle_bootup_task() Cheng Jian <cj.chengjian@huawei.com> - 2017-08-04 11:20 +0200
    Re: [PATCH] sched/core: Remove unnecessary initialization  init_idle_bootup_task() Peter Zijlstra <peterz@infradead.org> - 2017-08-04 11:50 +0200
    [tip:sched/core] sched/core: Remove unnecessary initialization  init_idle_bootup_task() tip-bot for Cheng Jian <tipbot@zytor.com> - 2017-08-10 14:20 +0200

#1703813 — [PATCH] sched/core: Remove unnecessary initialization init_idle_bootup_task()

FromCheng Jian <cj.chengjian@huawei.com>
Date2017-08-04 11:20 +0200
Subject[PATCH] sched/core: Remove unnecessary initialization init_idle_bootup_task()
Message-ID<uaGVX-56P-3@gated-at.bofh.it>
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

[toc] | [next] | [standalone]


#1703831 — Re: [PATCH] sched/core: Remove unnecessary initialization init_idle_bootup_task()

FromPeter Zijlstra <peterz@infradead.org>
Date2017-08-04 11:50 +0200
SubjectRe: [PATCH] sched/core: Remove unnecessary initialization init_idle_bootup_task()
Message-ID<uaHoZ-5ix-1@gated-at.bofh.it>
In reply to#1703813
On Fri, Aug 04, 2017 at 05:19:37PM +0800, Cheng Jian wrote:
> 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()

Yeah, does look a bit redundant. Thanks!

[toc] | [prev] | [next] | [standalone]


#1708543 — [tip:sched/core] sched/core: Remove unnecessary initialization init_idle_bootup_task()

Fromtip-bot for Cheng Jian <tipbot@zytor.com>
Date2017-08-10 14:20 +0200
Subject[tip:sched/core] sched/core: Remove unnecessary initialization init_idle_bootup_task()
Message-ID<ucUBv-5tj-87@gated-at.bofh.it>
In reply to#1703813
Commit-ID:  18f08dae19990f5fffde92e3a63e0d90cda0f1a8
Gitweb:     http://git.kernel.org/tip/18f08dae19990f5fffde92e3a63e0d90cda0f1a8
Author:     Cheng Jian <cj.chengjian@huawei.com>
AuthorDate: Fri, 4 Aug 2017 17:19:37 +0800
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Thu, 10 Aug 2017 12:18:18 +0200

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>
---
 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 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);
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 835a234..6d91c10 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

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web