]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/64s: Idle POWER8 avoid full state loss recovery where possible
authorNicholas Piggin <npiggin@gmail.com>
Wed, 19 Apr 2017 13:05:50 +0000 (23:05 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Sun, 23 Apr 2017 10:32:12 +0000 (20:32 +1000)
commit9a76309d1bf44f6709ad1f28f3d6aed04981c2ff
tree8876c07f27927d3290451a9b9795d63423ce8099
parent74984085a3cae2bf946d4285cc7f689a77ac0897
powerpc/64s: Idle POWER8 avoid full state loss recovery where possible

If not all threads were in winkle, full state loss recovery is not
necessary and can be avoided. A previous patch removed this optimisation
due to some complexity with the implementation. Re-implement it by
counting the number of threads in winkle with the per-core idle state.
Only restore full state loss if all threads were in winkle.

This has a small window of false positives right before threads execute
winkle and just after they wake up, when the winkle count does not
reflect the true number of threads in winkle. This is not a significant
problem in comparison with even the minimum winkle duration. For
correctness, a false positive is not a problem (only false negatives
would be).

Reviewed-by: Gautham R. Shenoy <ego@linux.vnet.ibm.com>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/include/asm/cpuidle.h
arch/powerpc/kernel/idle_book3s.S