From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D56BEC4332F for ; Mon, 11 Oct 2021 21:17:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BD1E6600D4 for ; Mon, 11 Oct 2021 21:17:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235271AbhJKVTM (ORCPT ); Mon, 11 Oct 2021 17:19:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53386 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235253AbhJKVTK (ORCPT ); Mon, 11 Oct 2021 17:19:10 -0400 Received: from mail-qt1-x832.google.com (mail-qt1-x832.google.com [IPv6:2607:f8b0:4864:20::832]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 23FA4C061570 for ; Mon, 11 Oct 2021 14:17:10 -0700 (PDT) Received: by mail-qt1-x832.google.com with SMTP id t16so5476204qto.5 for ; Mon, 11 Oct 2021 14:17:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=aFaiNjeTvld1X0vmZ2G8WJDTc5Mp6lRCwddZ5BoVR2Q=; b=Gb2RHde2HCKly4rPx15NmHm1f7OWhrDTPB3a0iaNuflguTgncOk7Kvaw1KLKEdTaJO J3AGNOCXxeWy7w2MnHfbSydxQuJhSg4TWodM8k8FSXRmijzpYmSwwufNcfKGVqScyex+ 2Ozg675RNYEVr4++41Mr1WyJwkpyvI6Gt2UuzdHqsTjlUaRrtfxqCgiLIjrIYqhOo1zk 7LT0LEsYSqoEn4P2vgDEl2xHywR5AZulDVopV0wnwTW9xV2e6ncAFzzUXosQGjpp1txA zIylJcrs6sMShuvPgi8O+by4rUyYbYOXiTVrQnoRjeWfM4dz+kVNmgl+hHigM/8Z/uzx LDHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=aFaiNjeTvld1X0vmZ2G8WJDTc5Mp6lRCwddZ5BoVR2Q=; b=6BljfqfJFCnEc0ZPQv3rEc27rYWg/MfdyajptTmEf8okcA3keXcc5H+QlaGUY+cSoc OueuvVvlK+DJmVXrYcKzk8CZPwuHAwWb00pQ2tDOIRTDj4Niw2WSAl7hDfhKQlgm2Dvj fqKkgyUdnOmkwub8loG9h29YkOxAeKoqFDI6Is8weRpAxkADFvPlop8PLgWt8fRSNDpJ 09JBaxmzta1Vx70jcYeu//CoNRP+oTERC/UVsO0vV1NJMlOYCqo9Ad8Wgj7l0oFg7VT/ nu4HqSsNw/CyujD8CCG2+EJcLh9k0oHHlm7HbA6Wge6Fx65jD6xyMC87T/IyNaOXN3GG 2cyQ== X-Gm-Message-State: AOAM533DajsNAQV3pfhoCEmhQYTw51jl5HetlR5vZwYCrLcTtfX8gva7 aG4hgK2cPkRnoPyDRxuWHb/srA== X-Google-Smtp-Source: ABdhPJz7OaV0k5DNpo+Cq2aVen8Ye/B/FsyQaMp+I9D3BUe3XJWtXSXSh7FNWC9QRXKN+u3xiB6WjA== X-Received: by 2002:ac8:3e8a:: with SMTP id y10mr17839236qtf.31.1633987029152; Mon, 11 Oct 2021 14:17:09 -0700 (PDT) Received: from [192.168.1.93] (pool-71-163-245-5.washdc.fios.verizon.net. [71.163.245.5]) by smtp.gmail.com with ESMTPSA id c7sm3252830qke.78.2021.10.11.14.17.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 11 Oct 2021 14:17:08 -0700 (PDT) Subject: Re: [PATCH 3/5] cpufreq: qcom-cpufreq-hw: Update offline CPUs per-cpu thermal pressure To: Lukasz Luba , linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, sudeep.holla@arm.com, will@kernel.org, catalin.marinas@arm.com, linux@armlinux.org.uk, gregkh@linuxfoundation.org, rafael@kernel.org, viresh.kumar@linaro.org, amitk@kernel.org, daniel.lezcano@linaro.org, amit.kachhap@gmail.com, bjorn.andersson@linaro.org, agross@kernel.org References: <20211007080729.8262-1-lukasz.luba@arm.com> <20211007080729.8262-4-lukasz.luba@arm.com> From: Thara Gopinath Message-ID: Date: Mon, 11 Oct 2021 17:17:08 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20211007080729.8262-4-lukasz.luba@arm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/7/21 4:07 AM, Lukasz Luba wrote: > 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") > Signed-off-by: Lukasz Luba Thanks for the fix. Reviewed-by: Thara Gopinath > --- > 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 a2be0df7e174..0138b2ec406d 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 > -- Warm Regards Thara (She/Her/Hers)