The patch titled sched: fix jiffies comparisons in the balancing code has been added to the -mm tree. Its filename is sched-fix-jiffies-comparisons-in-the-balancing-code.patch See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this ------------------------------------------------------ Subject: sched: fix jiffies comparisons in the balancing code From: Christoph Lameter <clameter@xxxxxxx> 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 <clameter@xxxxxxx> Cc: Ingo Molnar <mingo@xxxxxxx> Cc: Nick Piggin <nickpiggin@xxxxxxxxxxxx> Cc: "Siddha, Suresh B" <suresh.b.siddha@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- kernel/sched.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff -puN kernel/sched.c~sched-fix-jiffies-comparisons-in-the-balancing-code kernel/sched.c --- a/kernel/sched.c~sched-fix-jiffies-comparisons-in-the-balancing-code +++ a/kernel/sched.c @@ -2765,8 +2765,10 @@ static void idle_balance(int this_cpu, s /* If we've pulled tasks over stop searching: */ pulled_task = load_balance_newidle(this_cpu, this_rq, sd); - next_balance = min(next_balance, - sd->last_balance + sd->balance_interval); + if (time_after(next_balance, + sd->last_balance + sd->balance_interval)) + next_balance = sd->last_balance + + sd->balance_interval; if (pulled_task) break; } @@ -2890,7 +2892,7 @@ static void rebalance_domains(unsigned l 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 @@ -2909,8 +2911,8 @@ static void rebalance_domains(unsigned l * then idle_balance will reset next_balance so that we * rebalance earlier. */ - next_balance = min(next_balance, - sd->last_balance + interval); + if (time_after(next_balance, sd->last_balance + interval)) + next_balance = sd->last_balance + interval; } this_rq->next_balance = next_balance; } @@ -3167,7 +3169,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)) tasklet_schedule(&rebalance); #endif } _ Patches currently in -mm which might be from clameter@xxxxxxx are origin.patch memory-page-alloc-minor-cleanups.patch memory-page-alloc-minor-cleanups-fix.patch get-rid-of-zone_table.patch deal-with-cases-of-zone_dma-meaning-the-first-zone.patch get-rid-of-zone_table-fix-3.patch introduce-config_zone_dma.patch optional-zone_dma-in-the-vm.patch optional-zone_dma-in-the-vm-no-gfp_dma-check-in-the-slab-if-no-config_zone_dma-is-set.patch optional-zone_dma-in-the-vm-no-gfp_dma-check-in-the-slab-if-no-config_zone_dma-is-set-reduce-config_zone_dma-ifdefs.patch optional-zone_dma-for-ia64.patch remove-zone_dma-remains-from-parisc.patch remove-zone_dma-remains-from-sh-sh64.patch set-config_zone_dma-for-arches-with-generic_isa_dma.patch zoneid-fix-up-calculations-for-zoneid_pgshift.patch radix-tree-rcu-lockless-readside.patch sched-avoid-taking-rq-lock-in-wake_priority_sleeper.patch sched-disable-interrupts-for-locking-in-load_balance.patch sched-extract-load-calculation-from-rebalance_tick.patch sched-stagger-load-balancing-in-build_sched_domains.patch sched-move-idle-stat-calculation-into-rebalance_tick.patch sched-use-tasklet-to-call-balancing.patch sched-call-tasklet-less-frequently.patch sched-fix-jiffies-comparisons-in-the-balancing-code.patch zvc-support-nr_slab_reclaimable--nr_slab_unreclaimable-swap_prefetch.patch reduce-max_nr_zones-swap_prefetch-remove-incorrect-use-of-zone_highmem.patch numa-add-zone_to_nid-function-swap_prefetch.patch readahead-state-based-method-aging-accounting.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html