From f21941f66d3c8c267adf334e7f9fb4b40594cd9c Mon Sep 17 00:00:00 2001 From: Mike Galbraith Date: Wed, 27 Jul 2011 17:14:55 +0200 Subject: [PATCH] --- yaml --- r: 269133 b: refs/heads/master c: c350a04efd1c89cd256b2abc8f07a21d0d53ff24 h: refs/heads/master i: 269131: 62078f063ccc49ff7efa6d36d6adb30492d4bdf7 v: v3 --- [refs] | 2 +- trunk/kernel/sched.c | 25 ++++++++++++------------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/[refs] b/[refs] index d052570fe658..5f48c99c10e2 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 2c2efaed9bc973e3aeab1385c618017b56c8f6d7 +refs/heads/master: c350a04efd1c89cd256b2abc8f07a21d0d53ff24 diff --git a/trunk/kernel/sched.c b/trunk/kernel/sched.c index b1e8f0eca1f9..cf427bb2b65e 100644 --- a/trunk/kernel/sched.c +++ b/trunk/kernel/sched.c @@ -2843,20 +2843,24 @@ void sched_fork(struct task_struct *p) */ p->state = TASK_RUNNING; + /* + * Make sure we do not leak PI boosting priority to the child. + */ + p->prio = current->normal_prio; + /* * Revert to default priority/policy on fork if requested. */ if (unlikely(p->sched_reset_on_fork)) { - if (p->policy == SCHED_FIFO || p->policy == SCHED_RR) { + if (task_has_rt_policy(p)) { p->policy = SCHED_NORMAL; - p->normal_prio = p->static_prio; - } - - if (PRIO_TO_NICE(p->static_prio) < 0) { p->static_prio = NICE_TO_PRIO(0); - p->normal_prio = p->static_prio; - set_load_weight(p); - } + p->rt_priority = 0; + } else if (PRIO_TO_NICE(p->static_prio) < 0) + p->static_prio = NICE_TO_PRIO(0); + + p->prio = p->normal_prio = __normal_prio(p); + set_load_weight(p); /* * We don't need the reset flag anymore after the fork. It has @@ -2865,11 +2869,6 @@ void sched_fork(struct task_struct *p) p->sched_reset_on_fork = 0; } - /* - * 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;