• Nicholas Piggin's avatar
    powerpc/64s: Idle POWER8 avoid full state loss recovery where possible · 0d7720a2
    Nicholas Piggin authored
    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: default avatarGautham R. Shenoy <ego@linux.vnet.ibm.com>
    Signed-off-by: default avatarNicholas Piggin <npiggin@gmail.com>
    Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
    0d7720a2
cpuidle.h 3.54 KB