sched/numa: Fix math underflow in task_tick_numa()
authorRik van Riel <riel@redhat.com>
Thu, 5 Nov 2015 20:56:22 +0000 (15:56 -0500)
committerIngo Molnar <mingo@kernel.org>
Mon, 9 Nov 2015 15:13:27 +0000 (16:13 +0100)
commit25b3e5a3344e1f700c1efec5b6f0199f04707fb1
tree5f3b54f6f8f9a207fc717bda3902f47d83be91f0
parent66ef3493d4bb387f5a83915e33dc893102fd1b43
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>
kernel/sched/fair.c