Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 269133
b: refs/heads/master
c: c350a04
h: refs/heads/master
i:
  269131: 62078f0
v: v3
  • Loading branch information
Mike Galbraith authored and Ingo Molnar committed Aug 14, 2011
1 parent 8def7c6 commit f21941f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2c2efaed9bc973e3aeab1385c618017b56c8f6d7
refs/heads/master: c350a04efd1c89cd256b2abc8f07a21d0d53ff24
25 changes: 12 additions & 13 deletions trunk/kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;

Expand Down

0 comments on commit f21941f

Please sign in to comment.