Skip to content

Commit

Permalink
sched: Add SCHED_RESET_ON_FORK functionality for nice < 0 tasks
Browse files Browse the repository at this point in the history
Signed-off-by: Mike Galbraith <efault@gmx.de>
Acked-by: Lennart Poettering <mzxreary@0pointer.de>
Cc: Peter Zijlstra <peterz@infradead.org>
LKML-Reference: <1245228482.27326.1.camel@marge.simson.net>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Mike Galbraith authored and Ingo Molnar committed Jun 17, 2009
1 parent b9dc29e commit 6c697bd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -2627,6 +2627,11 @@ void sched_fork(struct task_struct *p, int clone_flags)
if (p->normal_prio < DEFAULT_PRIO)
p->prio = DEFAULT_PRIO;

if (PRIO_TO_NICE(p->static_prio) < 0) {
p->static_prio = NICE_TO_PRIO(0);
set_load_weight(p);
}

/*
* We don't need the reset flag anymore after the fork. It has
* fulfilled its duty:
Expand Down

0 comments on commit 6c697bd

Please sign in to comment.