• Rafael J. Wysocki's avatar
    cpuidle: teo: Allow tick to be stopped if PM QoS is used · cab09f3d
    Rafael J. Wysocki authored
    The TEO goveror prevents the scheduler tick from being stopped (unless
    stopped already) if there is a PM QoS latency constraint for the given
    CPU and the target residency of the deepest idle state matching that
    constraint is below the tick boundary.
    
    However, that is problematic if CPUs with PM QoS latency constraints
    are idle for long times, because it effectively causes the tick to
    run on them all the time which is wasteful.  [It is also confusing
    and questionable if they are full dynticks CPUs.]
    
    To address that issue, modify the TEO governor to carry out the
    entire search for the most suitable idle state (from the target
    residency perspective) even if a latency constraint is present,
    to allow it to determine the expected idle duration in all cases.
    
    Also, when using the last several measured idle duration values
    to refine the idle state selection, make it compare those values
    with the current expected idle duration value (instead of
    comparing them with the target residency of the idle state
    selected so far) which should prevent the tick from being
    retained when it makes sense to stop it sometimes (especially
    in the presence of PM QoS latency constraints).
    
    Fixes: b26bf6ab ("cpuidle: New timer events oriented governor for tickless systems")
    Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
    cab09f3d
teo.c 13.7 KB