On Thu, Mar 26, 2015 at 05:47:00PM +0000, Peter Zijlstra wrote:
On Thu, Mar 26, 2015 at 05:38:45PM +0000, Morten Rasmussen wrote:
Another potential solution is to stay with weak functions but move the multiplication and shift into the arch_scale_*() functions by passing the value we want to scale into the arch_scale_*() function. That way we can completely avoid multiplication and shift in the default case (no arch_scale*() implementations, which is better than what we have today.
The only downside is that for frequency invariance we need three arch_scale_freq_capacity() calls instead of two.
That would still result in unconditional function calls, which on some archs are _more_ expensive than 64bit mults.
Right. Then it can only be preprocessor magic I think.