lkml.org 
[lkml]   [2022]   [Jan]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.16 0165/1039] cpufreq: qcom-cpufreq-hw: Update offline CPUs per-cpu thermal pressure
    Date
    From: Lukasz Luba <lukasz.luba@arm.com>

    [ Upstream commit 93d9e6f93e1586fcc97498c764be2e8c8401f4bd ]

    The thermal pressure signal gives information to the scheduler about
    reduced CPU capacity due to thermal. It is based on a value stored in
    a per-cpu 'thermal_pressure' variable. The online CPUs will get the
    new value there, while the offline won't. Unfortunately, when the CPU
    is back online, the value read from per-cpu variable might be wrong
    (stale data). This might affect the scheduler decisions, since it
    sees the CPU capacity differently than what is actually available.

    Fix it by making sure that all online+offline CPUs would get the
    proper value in their per-cpu variable when there is throttling
    or throttling is removed.

    Fixes: 275157b367f479 ("cpufreq: qcom-cpufreq-hw: Add dcvs interrupt support")
    Reviewed-by: Thara Gopinath <thara.gopinath@linaro.org>
    Signed-off-by: Lukasz Luba <lukasz.luba@arm.com>
    Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    drivers/cpufreq/qcom-cpufreq-hw.c | 3 ++-
    1 file changed, 2 insertions(+), 1 deletion(-)

    diff --git a/drivers/cpufreq/qcom-cpufreq-hw.c b/drivers/cpufreq/qcom-cpufreq-hw.c
    index a2be0df7e1747..0138b2ec406dc 100644
    --- a/drivers/cpufreq/qcom-cpufreq-hw.c
    +++ b/drivers/cpufreq/qcom-cpufreq-hw.c
    @@ -304,7 +304,8 @@ static void qcom_lmh_dcvs_notify(struct qcom_cpufreq_data *data)
    if (capacity > max_capacity)
    capacity = max_capacity;

    - arch_set_thermal_pressure(policy->cpus, max_capacity - capacity);
    + arch_set_thermal_pressure(policy->related_cpus,
    + max_capacity - capacity);

    /*
    * In the unlikely case policy is unregistered do not enable
    --
    2.34.1


    \
     
     \ /
      Last update: 2022-01-24 23:09    [W:2.645 / U:1.500 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site