Skip to content

Commit

Permalink
sched: Adjust p->sched_reset_on_fork when nothing else changes
Browse files Browse the repository at this point in the history
If the policy and priority remain unchanged a possible modification of
p->sched_reset_on_fork gets lost in the early exit path.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
[ Rebase ontop of v3.14-rc1. ]
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1391803122-4425-5-git-send-email-bigeasy@linutronix.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
  • Loading branch information
Thomas Gleixner authored and Ingo Molnar committed Feb 22, 2014
1 parent 8f47b18 commit d6b1e91
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion kernel/sched/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -3362,7 +3362,8 @@ static int __sched_setscheduler(struct task_struct *p,
}

/*
* If not changing anything there's no need to proceed further:
* If not changing anything there's no need to proceed further,
* but store a possible modification of reset_on_fork.
*/
if (unlikely(policy == p->policy)) {
if (fair_policy(policy) && attr->sched_nice != task_nice(p))
Expand All @@ -3372,6 +3373,7 @@ static int __sched_setscheduler(struct task_struct *p,
if (dl_policy(policy))
goto change;

p->sched_reset_on_fork = reset_on_fork;
task_rq_unlock(rq, p, &flags);
return 0;
}
Expand Down

0 comments on commit d6b1e91

Please sign in to comment.