Skip to content
  • Chen Yu's avatar
    cpufreq: governors: Fix long idle detection logic in load calculation · 75920196
    Chen Yu authored
    According to current code implementation, detecting the long
    idle period is done by checking if the interval between two
    adjacent utilization update handlers is long enough. Although
    this mechanism can detect if the idle period is long enough
    (no utilization hooks invoked during idle period), it might
    not cover a corner case: if the task has occupied the CPU
    for too long which causes no context switches during that
    period, then no utilization handler will be launched until this
    high prio task is scheduled out. As a result, the idle_periods
    field might be calculated incorrectly because it regards the
    100% load as 0% and makes the conservative governor who uses
    this field confusing.
    Change the detection to compare the idle_time with sampling_rate
    Reported-by: default avatarArtem S. Tashkinov <>
    Signed-off-by: default avatarChen Yu <>
    Acked-by: default avatarViresh Kumar <>
    Cc: All applicable <>
    Signed-off-by: default avatarRafael J. Wysocki <>