| Subject: sched: Adjust sched_reset_on_fork when nothing else changes |
| From: Thomas Gleixner <tglx@linutronix.de> |
| Date: Thu, 20 Dec 2012 14:58:00 +0100 |
| |
| If the policy and priority remain unchanged a possible modification of |
| sched_reset_on_fork gets lost in the early exit path. |
| |
| Signed-off-by: Thomas Gleixner <tglx@linutronix.de> |
| Cc: stable@vger.kernel.org |
| Cc: stable-rt@vger.kernel.org |
| --- |
| kernel/sched/core.c | 5 ++++- |
| 1 file changed, 4 insertions(+), 1 deletion(-) |
| |
| --- a/kernel/sched/core.c |
| +++ b/kernel/sched/core.c |
| @@ -4119,10 +4119,13 @@ recheck: |
| } |
| |
| /* |
| - * 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 && (!rt_policy(policy) || |
| param->sched_priority == p->rt_priority))) { |
| + p->sched_reset_on_fork = reset_on_fork; |
| task_rq_unlock(rq, p, &flags); |
| return 0; |
| } |