Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d6b1e911 authored by Thomas Gleixner's avatar Thomas Gleixner Committed by Ingo Molnar
Browse files

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: default avatarThomas Gleixner <tglx@linutronix.de>
[ Rebase ontop of v3.14-rc1. ]
Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: default avatarPeter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1391803122-4425-5-git-send-email-bigeasy@linutronix.de


Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent 8f47b187
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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))
@@ -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;
	}