--- linux-2.5.70.virgin/kernel/sched.c.org Tue Jun 3 06:44:48 2003 +++ linux-2.5.70.virgin/kernel/sched.c Tue Jun 3 17:28:10 2003 @@ -66,7 +66,7 @@ */ #define MIN_TIMESLICE ( 10 * HZ / 1000) #define MAX_TIMESLICE (200 * HZ / 1000) -#define CHILD_PENALTY 50 +#define CHILD_PENALTY 80 #define PARENT_PENALTY 100 #define EXIT_WEIGHT 3 #define PRIO_BONUS_RATIO 25 @@ -355,6 +355,7 @@ * spends sleeping, the higher the average gets - and the * higher the priority boost gets as well. */ + sleep_time = min(sleep_time, (long) p->time_slice); sleep_avg = p->sleep_avg + sleep_time; /* @@ -545,8 +546,10 @@ * and children as well, to keep max-interactive tasks * from forking tasks that are max-interactive. */ - current->sleep_avg = current->sleep_avg * PARENT_PENALTY / 100; - p->sleep_avg = p->sleep_avg * CHILD_PENALTY / 100; + if (likely(current->parent->pid > 1)) { + current->sleep_avg = current->sleep_avg * PARENT_PENALTY / 100; + p->sleep_avg = p->sleep_avg * CHILD_PENALTY / 100; + } else current->sleep_avg = p->sleep_avg = MAX_SLEEP_AVG; p->prio = effective_prio(p); set_task_cpu(p, smp_processor_id());