Fix up jiffy comparison function in the scheduler. The jiffy comparison in reblance_tick() has always used a simple integer comparison and I have followed that convention for the patchset that rebalances sched domains via a tasklet. However, jiffies may wrap around zero. If we do not use the time_after() function then comparisons may not give the intended results. Fix this up by using jiffy comparison functions. Signed-off-by: Christoph Lameter Index: linux-2.6.19-rc5-mm1/kernel/sched.c =================================================================== --- linux-2.6.19-rc5-mm1.orig/kernel/sched.c 2006-11-10 23:04:14.000000000 -0600 +++ linux-2.6.19-rc5-mm1/kernel/sched.c 2006-11-10 23:05:55.460108319 -0600 @@ -2898,7 +2898,7 @@ static void run_rebalance_domains(struct if (unlikely(!interval)) interval = 1; - if (jiffies - sd->last_balance >= interval) { + if (time_after_eq(jiffies, sd->last_balance + interval)) { if (load_balance(this_cpu, this_rq, sd, idle)) { /* * We've pulled tasks over so either we're no @@ -3165,7 +3165,7 @@ void scheduler_tick(void) task_running_tick(rq, p); #ifdef CONFIG_SMP update_load(rq); - if (jiffies >= rq->next_balance) + if (time_after_eq(jiffies, rq->next_balance)) raise_softirq(SCHED_SOFTIRQ); #endif }