sched/numa: Fix math underflow in task_tick_numa()

The NUMA balancing code implements delays in scanning by
advancing curr->node_stamp beyond curr->se.sum_exec_runtime.

With unsigned math, that creates an underflow, which results
in task_numa_work being queued all the time, even when we
don't want to.

Avoiding the math underflow makes it possible to reduce CPU
overhead in the NUMA balancing code.

Reported-and-tested-by: Jan Stancek <jstancek@redhat.com>
Signed-off-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: mgorman@suse.de
Link: http://lkml.kernel.org/r/1446756983-28173-2-git-send-email-riel@redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>

authored by Rik van Riel and committed by Ingo Molnar 25b3e5a3 66ef3493

Changed files
+1 -1
kernel
sched
+1 -1
kernel/sched/fair.c
··· 2302 2302 now = curr->se.sum_exec_runtime; 2303 2303 period = (u64)curr->numa_scan_period * NSEC_PER_MSEC; 2304 2304 2305 - if (now - curr->node_stamp > period) { 2305 + if (now > curr->node_stamp + period) { 2306 2306 if (!curr->node_stamp) 2307 2307 curr->numa_scan_period = task_scan_min(curr); 2308 2308 curr->node_stamp += period;