]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
sched: Optimize freq invariant accounting
authorPeter Zijlstra <peterz@infradead.org>
Mon, 23 Mar 2015 13:19:05 +0000 (14:19 +0100)
committerIngo Molnar <mingo@kernel.org>
Fri, 27 Mar 2015 08:36:08 +0000 (09:36 +0100)
commitdfbca41f347997e57048a53755611c8e2d792924
treed6afb30dd110cf31995b259db11b5fc7185f6895
parent1aaf90a4b88aae26a4535ba01dacab520a310d17
sched: Optimize freq invariant accounting

Currently the freq invariant accounting (in
__update_entity_runnable_avg() and sched_rt_avg_update()) get the
scale factor from a weak function call, this means that even for archs
that default on their implementation the compiler cannot see into this
function and optimize the extra scaling math away.

This is sad, esp. since its a 64-bit multiplication which can be quite
costly on some platforms.

So replace the weak function with #ifdef and __always_inline goo. This
is not quite as nice from an arch support PoV but should at least
result in compile time errors if done wrong.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Ben Segall <bsegall@google.com>
Cc: Morten.Rasmussen@arm.com
Cc: Paul Turner <pjt@google.com>
Cc: Vincent Guittot <vincent.guittot@linaro.org>
Cc: dietmar.eggemann@arm.com
Cc: efault@gmx.de
Cc: kamalesh@linux.vnet.ibm.com
Cc: nicolas.pitre@linaro.org
Cc: preeti@linux.vnet.ibm.com
Cc: riel@redhat.com
Link: http://lkml.kernel.org/r/20150323131905.GF23123@twins.programming.kicks-ass.net
Signed-off-by: Ingo Molnar <mingo@kernel.org>
kernel/sched/fair.c
kernel/sched/sched.h