sched/fair: Optimize per entity utilization tracking
authorPeter Zijlstra <peterz@infradead.org>
Wed, 9 Sep 2015 07:06:17 +0000 (09:06 +0200)
committerIngo Molnar <mingo@kernel.org>
Sun, 13 Sep 2015 07:53:02 +0000 (09:53 +0200)
commit006cdf025a33cb008c3d466bed311c2c347b458f
tree93514a7de219a4fddf47cfeac20010f7f4912f6f
parent6f2b04524f0b38bfbb8413f98d2d6af234508309
sched/fair: Optimize per entity utilization tracking

Currently the load_{sum,avg} and util_{sum,avg} tracking is asymmetric
in that load tracking gets a 2^10 unit from the weight, but util gets
no such factor.

This results in more lost bits for util scaling and asymmetric scaling
rules.

Fix this by removing shifts, such that we gain the 2^10 factor from
scaling. There is no risk of overflowing the u32 as the max value is
now LOAD_AVG_MAX << 10, which is still well below UINT_MAX.

This further entangles the assumption that both LOAD and CAPACITY
shifts are the same (and 10) so put in an assertion for that.

This fixes the math for the LOAD_RESOLUTION != 0 case.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
kernel/sched/fair.c