sched/fair: Align PELT windows between cfs_rq and its se
commitf207934fb79d1af1de1a62b09d56a3a1914172c4
authorPeter Zijlstra <peterz@infradead.org>
Fri, 12 May 2017 12:16:30 +0000 (12 14:16 +0200)
committerIngo Molnar <mingo@kernel.org>
Fri, 29 Sep 2017 17:35:16 +0000 (29 19:35 +0200)
treea1068ceb835ec41fd0004f428c2db25496c5c261
parent144d8487bc6e9b741895709cb46d4e19b748a725
sched/fair: Align PELT windows between cfs_rq and its se

The PELT _sum values are a saw-tooth function, dropping on the decay
edge and then growing back up again during the window.

When these window-edges are not aligned between cfs_rq and se, we can
have the situation where, for example, on dequeue, the se decays
first.

Its _sum values will be small(er), while the cfs_rq _sum values will
still be on their way up. Because of this, the subtraction:
cfs_rq->avg._sum -= se->avg._sum will result in a positive value. This
will then, once the cfs_rq reaches an edge, translate into its _avg
value jumping up.

This is especially visible with the runnable_load bits, since they get
added/subtracted a lot.

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: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
kernel/sched/fair.c