Skip to content

Commit d6b1e91

Browse files
KAGA-KOKOIngo Molnar
authored andcommitted
sched: Adjust p->sched_reset_on_fork when nothing else changes
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>
1 parent 8f47b18 commit d6b1e91

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

kernel/sched/core.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3362,7 +3362,8 @@ static int __sched_setscheduler(struct task_struct *p,
33623362
}
33633363

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

3376+
p->sched_reset_on_fork = reset_on_fork;
33753377
task_rq_unlock(rq, p, &flags);
33763378
return 0;
33773379
}

0 commit comments

Comments
 (0)