Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 158317
b: refs/heads/master
c: b9dc29e
h: refs/heads/master
i:
  158315: 0d42b89
v: v3
  • Loading branch information
Mike Galbraith authored and Ingo Molnar committed Jun 17, 2009
1 parent 0dbb82a commit f083181
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 17 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: ca94c442535a44d508c99a77e54f21a59f4fc462
refs/heads/master: b9dc29e72fd3dc2a739ce8eafd958220d0745734
34 changes: 18 additions & 16 deletions trunk/kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -2613,28 +2613,30 @@ void sched_fork(struct task_struct *p, int clone_flags)
set_task_cpu(p, cpu);

/*
* Revert to default priority/policy on fork if requested. Make sure we
* do not leak PI boosting priority to the child.
* Make sure we do not leak PI boosting priority to the child.
*/
if (current->sched_reset_on_fork &&
(p->policy == SCHED_FIFO || p->policy == SCHED_RR))
p->policy = SCHED_NORMAL;
p->prio = current->normal_prio;

if (current->sched_reset_on_fork &&
(current->normal_prio < DEFAULT_PRIO))
p->prio = DEFAULT_PRIO;
else
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)
p->policy = SCHED_NORMAL;

if (p->normal_prio < DEFAULT_PRIO)
p->prio = DEFAULT_PRIO;

/*
* We don't need the reset flag anymore after the fork. It has
* fulfilled its duty:
*/
p->sched_reset_on_fork = 0;
}

if (!rt_prio(p->prio))
p->sched_class = &fair_sched_class;

/*
* We don't need the reset flag anymore after the fork. It has
* fulfilled its duty:
*/
p->sched_reset_on_fork = 0;

#if defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT)
if (likely(sched_info_on()))
memset(&p->sched_info, 0, sizeof(p->sched_info));
Expand Down

0 comments on commit f083181

Please sign in to comment.