Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1837701pxb; Mon, 11 Oct 2021 14:20:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy+r0JOtlRYv428zXNHkeHISsBPSUPpPbrEKG5uJKj+Y+/Yurp/9WjjrAZvpM4AXuOYKIGW X-Received: by 2002:a17:906:5950:: with SMTP id g16mr28744240ejr.149.1633987221339; Mon, 11 Oct 2021 14:20:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633987221; cv=none; d=google.com; s=arc-20160816; b=Oto7WfsO6W5RPrcWD7tcoC9VX3QyKWszJxYsfujDovf6Ci2m2HmSk7nMNwNOF/yKZN UyHNqn0hB2uzSqOmLsgpLMIQXaiy1aJAl5KT0AWyMxqwKdvwKhsNreMY28HWCk2Ux3vw kFsgpoL22+4cs7gpIuUEicaf9vbJT6HmCaDo0QKfg6NLn2ed0N6Rl0/HOKbggxXbaoKY cYI7SJ8nDP3arteYQ6/9ze9tuX00VeM0mjWqQuCgq7a5RNvWmraDt0TBrD2hlRyD3Vci b+fFT6aHZN1N2Skr+yeIHogbMWMGfJILgmeT/9PafcwYBDnoDq3FZMhm5fZ4UR60QL5M GbPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=aFaiNjeTvld1X0vmZ2G8WJDTc5Mp6lRCwddZ5BoVR2Q=; b=yQU4TomFpn3jeprOXFy3XWuMykcqQcF3EkpVH3s98ZB1i7ULmcFMFqYHI+5lVUbWN9 Vz+WjC4lcZDWLCMQQnYTRii9PkNy/VrHtp4BtoY/kxpFD51yocSy5cgfsDyUTfCj4F1Z dVjcR4hxEifq7Un/TC5iHPFWL0jKJnzQ/jF3eM5fj5ALt0xzh1/WCmNID+FMUBA7s9uZ n1FCiQVAB2LlIJK5AItREZHHjO5nNe2+67maegiU16KYU7+uDMIi4bFUYzhIk35q2dv3 lvK7GfgQ6jXyRVhR5mN3m3yWg13gCgZpbMGUqfvalnWlTe3Tjj/3LMbruxE613o1IeFv Aarg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Gb2RHde2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 3si11905020ejq.564.2021.10.11.14.19.57; Mon, 11 Oct 2021 14:20:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Gb2RHde2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235263AbhJKVTL (ORCPT + 99 others); Mon, 11 Oct 2021 17:19:11 -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-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)