]> nv-tegra.nvidia Code Review - linux-2.6.git/commitdiff
sched: Add SCHED_RESET_ON_FORK functionality for nice < 0 tasks
authorMike Galbraith <efault@gmx.de>
Wed, 17 Jun 2009 08:48:02 +0000 (10:48 +0200)
committerIngo Molnar <mingo@elte.hu>
Wed, 17 Jun 2009 16:34:18 +0000 (18:34 +0200)
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>
kernel/sched.c

index 50e4e3d15e83ead57817f1dbacca3984dacd2729..34f94240642f6d6f435c06c60ccf86a7ac027ffc 100644 (file)
@@ -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: