summaryrefslogtreecommitdiffstats
path: root/kernel/sched.c
diff options
context:
space:
mode:
authorMike Galbraith <efault@gmx.de>2009-06-17 10:48:02 +0200
committerIngo Molnar <mingo@elte.hu>2009-06-17 18:34:18 +0200
commit6c697bdf08a09ce461e305a22362973036e95db3 (patch)
tree76f17d2a7786969780bebeb83d1d5d3290ae8120 /kernel/sched.c
parentb9dc29e72fd3dc2a739ce8eafd958220d0745734 (diff)
downloadblackbird-op-linux-6c697bdf08a09ce461e305a22362973036e95db3.tar.gz
blackbird-op-linux-6c697bdf08a09ce461e305a22362973036e95db3.zip
sched: Add SCHED_RESET_ON_FORK functionality for nice < 0 tasks
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>
Diffstat (limited to 'kernel/sched.c')
-rw-r--r--kernel/sched.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index 50e4e3d15e83..34f94240642f 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -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:
OpenPOWER on IntegriCloud