Skip to contentSkip to conversation

sched/core: emove unnecessary initialization in sched_init()

PATCH Superseded Cheng Chao 2 participants 4 messages Sep 14, 2016 – Sep 22, 2016

Subsystems (2)
lore
Share & tools
lore

Cheng Chao

author
#0 lore raw

PATCH 1/1 sched/core: emove unnecessary initialization in sched_init()

init_idle() is called immediately after current->sched_class = &fair_sched_class, init_idle() sets current->sched_class = &idle_sched_class.

---
 kernel/sched/core.c | 5 -----
 1 file changed, 5 deletions(-)
kernel/sched/core.c +0 -5
index a0086a5..ed4f4fe 100644
@@ -7557,11 +7557,6 @@ void __init sched_init(void)
 	enter_lazy_tlb(&init_mm, current);
 
 	/*
-	 * During early bootup we pretend to be a normal task:
-	 */
-	current->sched_class = &fair_sched_class;
-
-	/*
 	 * Make us the idle thread. Technically, schedule() should not be
 	 * called from this thread, however somewhere below it might be,
 	 * but because we are the idle thread, we just pick up running again
Signature · 1 line
2.4.11
author
#1 lore raw

PATCH v2 1/1 sched/core: remove unnecessary initialization in sched_init()

init_idle() is called immediately after current->sched_class = &fair_sched_class, init_idle() sets current->sched_class = &idle_sched_class.

---
 kernel/sched/core.c | 5 -----
 1 file changed, 5 deletions(-)
kernel/sched/core.c +0 -5
index a0086a5..ed4f4fe 100644
@@ -7557,11 +7557,6 @@ void __init sched_init(void)
 	enter_lazy_tlb(&init_mm, current);
 
 	/*
-	 * During early bootup we pretend to be a normal task:
-	 */
-	current->sched_class = &fair_sched_class;
-
-	/*
 	 * Make us the idle thread. Technically, schedule() should not be
 	 * called from this thread, however somewhere below it might be,
 	 * but because we are the idle thread, we just pick up running again
Signature · 1 line
2.4.11
author
#2 lore raw

Re: [PATCH v2] sched/core: remove unnecessary initialization in sched_init()

Hi Peter,

Would you please review this patch? thanks.

Cheng

Quoted 27 lines · Cheng Chao

init_idle() is called immediately after current->sched_class = &fair_sched_class, init_idle() sets current->sched_class = &idle_sched_class.

---
 kernel/sched/core.c | 5 -----
 1 file changed, 5 deletions(-)
kernel/sched/core.c +0 -5
index a0086a5..ed4f4fe 100644
@@ -7557,11 +7557,6 @@ void __init sched_init(void)
 	enter_lazy_tlb(&init_mm, current);
 
 	/*
-	 * During early bootup we pretend to be a normal task:
-	 */
-	current->sched_class = &fair_sched_class;
-
-	/*
 	 * Make us the idle thread. Technically, schedule() should not be
 	 * called from this thread, however somewhere below it might be,
 	 * but because we are the idle thread, we just pick up running again
#3 lore raw

[tip:sched/core] sched/core: Remove unnecessary initialization in sched_init()

In reply to Cheng Chao
sched/core: Remove unnecessary initialization in sched_init()
Commit-ID:  0b8473570ce1af3e80da05b59f9321f30253de4d
Gitweb:     http://git.kernel.org/tip/0b8473570ce1af3e80da05b59f9321f30253de4d
Author:     Cheng Chao <[email protected]>
AuthorDate: Wed, 14 Sep 2016 10:18:56 +0800
Committer:  Ingo Molnar <[email protected]>
CommitDate: Thu, 22 Sep 2016 14:53:44 +0200

sched/core: Remove unnecessary initialization in sched_init()

init_idle() is called immediately after:

  current->sched_class = &fair_sched_class;

init_idle() sets:

  current->sched_class = &idle_sched_class;

First assignment is superfluous.

---
 kernel/sched/core.c | 5 -----
 1 file changed, 5 deletions(-)
kernel/sched/core.c +0 -5
index 860070f..c5f020c 100644
@@ -7558,11 +7558,6 @@ void __init sched_init(void)
 	enter_lazy_tlb(&init_mm, current);
 
 	/*
-	 * During early bootup we pretend to be a normal task:
-	 */
-	current->sched_class = &fair_sched_class;
-
-	/*
 	 * Make us the idle thread. Technically, schedule() should not be
 	 * called from this thread, however somewhere below it might be,
 	 * but because we are the idle thread, we just pick up running again