--- linux-2.6.0-test3-mm1-O14.1/kernel/sched.c 2003-08-12 22:04:13.000000000 +1000 +++ linux-2.6.0-test3-mm1/kernel/sched.c 2003-08-12 22:03:47.000000000 +1000 @@ -620,8 +620,13 @@ repeat_lock_task: __activate_task(p, rq); else { activate_task(p, rq); - if (TASK_PREEMPTS_CURR(p, rq)) - resched_task(rq->curr); + /* + * Parents are not allowed to preempt their + * children + */ + if (TASK_PREEMPTS_CURR(p, rq) && + p != rq->curr->parent) + resched_task(rq->curr); } success = 1; } @@ -1124,7 +1129,7 @@ static inline void pull_task(runqueue_t * Note that idle threads have a prio of MAX_PRIO, for this test * to be always true for them. */ - if (TASK_PREEMPTS_CURR(p, this_rq)) + if (TASK_PREEMPTS_CURR(p, this_rq) && p != this_rq->curr->parent) set_need_resched(); } @@ -1493,9 +1498,8 @@ need_resched: * priority bonus */ if (HIGH_CREDIT(prev)) - run_time /= (MAX_BONUS + 1 - - (NS_TO_JIFFIES(prev->sleep_avg) * MAX_BONUS / - MAX_SLEEP_AVG)); + run_time /= ((NS_TO_JIFFIES(prev->sleep_avg) * MAX_BONUS / + MAX_SLEEP_AVG) ? : 1); spin_lock_irq(&rq->lock);