sched: cleanup adjusting sched_class
PATCH 1/1 sched: cleanup adjusting sched_class
Hi Ingo and Dmitry,
I made a clean-up patch about fixing invalid sched_class use.
Dmitry, could you please review and sign it?
The adjusting sched_class is a missing part of the already existing "do not leak PI boosting priority to the child" at the sched_fork(). This patch moves the adjusting sched_class from wake_up_new_task() to sched_fork().
---
kernel/sched.c +2 -5
@@ -1641,6 +1641,8 @@ void sched_fork(struct task_struct *p, int clone_flags)* Make sure we do not leak PI boosting priority to the child: */ p->prio = current->normal_prio; +if (!rt_prio (p->prio)) + p->sched_class = &fair_sched_class;#if defined(CONFIG_SCHEDSTATS ) || defined(CONFIG_TASK_DELAY_ACCT )if (likely (sched_info_on ()))
@@ -1682,11 +1684,6 @@ void fastcall wake_up_new_task(struct task_struct *p, unsigned long clone_flags) p->prio =effective_prio (p); -if (rt_prio (p->prio)) - p->sched_class = &rt_sched_class; -else - p->sched_class = &fair_sched_class; -if (!p->sched_class->task_new || !sysctl_sched_child_runs_first || (clone_flags &CLONE_VM ) ||task_cpu (p) != this_cpu || !current->se.on_rq) {
Quoted 3 lines · Hiroshi Shimamoto
Hi Ingo and Dmitry,
I made a clean-up patch about fixing invalid
sched_classuse.
thanks!
Quoted 10 lines
Dmitry, could you please review and sign it?
The adjusting
sched_classis a missing part of the already existing "do not leak PI boosting priority to the child" at thesched_fork(). This patch moves the adjustingsched_classfromwake_up_new_task()tosched_fork().Signed-off-by Hiroshi Shimamoto <[email protected]>
Signature · 2 lines
Best regards, Dmitry Adamushko
Quoted 11 lines · Dmitry Adamushko
Quoted 3 lines · Hiroshi Shimamoto
Hi Ingo and Dmitry,
I made a clean-up patch about fixing invalid
sched_classuse.thanks!
Quoted 4 lines
Dmitry, could you please review and sign it?
Quoted 8 lines
Quoted 6 lines
The adjusting
sched_classis a missing part of the already existing "do not leak PI boosting priority to the child" at thesched_fork(). This patch moves the adjustingsched_classfromwake_up_new_task()tosched_fork().Signed-off-by Hiroshi Shimamoto <[email protected]>Signed-off-by Dmitry Adamushko <[email protected]>
thanks - i've picked up Hiroshi's cleanup.
Ingo
Quoted 11 lines · Hiroshi Shimamoto
Hi Ingo and Dmitry,
I made a clean-up patch about fixing invalid
sched_classuse.Dmitry, could you please review and sign it?
The adjusting
sched_classis a missing part of the already existing "do not leak PI boosting priority to the child" at thesched_fork(). This patch moves the adjustingsched_classfromwake_up_new_task()tosched_fork().
thanks. Note that your cleanup also shrinks the code a bit:
text data bss dec hex filename 40111 4018 292 44421 ad85 sched.o.before 40102 4018 292 44412 ad7c sched.o.after
which never hurts :)
Ingo