Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1230299pxj; Fri, 18 Jun 2021 02:30:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwKu1s6IT1Gg3bbEaRLcfbOtzECOHv+stzFjO8ccZ4oadpwbdW2Jajz78iRDnI65POX3kEX X-Received: by 2002:a17:906:6d16:: with SMTP id m22mr284271ejr.333.1624008651901; Fri, 18 Jun 2021 02:30:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624008651; cv=none; d=google.com; s=arc-20160816; b=lkQkUfb0SAh3gvHxo9DjW88Z/Du0+ram8PuGqZfSgZkDAKwZ+NrS3NcthD+8CrlUAd YSlvUsVnvsZ8zWbKI8l28hZxv//eOwzDaVdHq3m+c1NVq+KDdtMA4CX/I23MT3K2BerD Ig5tddv04cbUOhGb5zPiQrlb5j35Wlw/ksy2J2ozp5ZG41zyS0o2e8schCmAuzL0mzvk cAldCZScvoMkZY23ZHoYMjZq7gyWc4alfgPO+hnUOAqSz8rOi3YUJxUk5Hd/bcCc5wkv 2dlWli96Aovv49iDJ79GFYAQRgEH1MxEMd9rA8K7taLhpAtgykOPweVhTI787/TTzue+ XOmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=ohcrc38O26Lfr2W3uV2igtbJnbPRi35ZDw36F/4nYKg=; b=DtuqhEncKvV0Ycsa/nmD1mZyPx+EVAS4XMIO2kxoKFpL0fSSTj+JfNhS9hi3Ma67Wv KXRFKzfd9uwR5E726CxIdax+0IHr1DP81DPE1mmmCBtODLUKQLAMW338ZgctmkNwOnWD 4VTNhSgd+di8fuZKD0aH3ENlXA/aXc+/i2d3JvcQZ6+Z0QEXXdnwy9m+wGkH4z+4vGuo zhxf8UIUXSMyjAlJVTPkVkTn9A/X4pLD0RMQxmsFK/n/PsmUR48J4gjXOh4krJSjx3kF wriAWyKR5wAH6G7hfHo/CFRNODq0ab7wdFEB1UuAwu585JtwkudYIWEVb+VPWXKA4SkD wlWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=SdVyRBum; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=PEEfJcgZ; 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=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ka11si2265326ejc.367.2021.06.18.02.30.28; Fri, 18 Jun 2021 02:30:51 -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=@linutronix.de header.s=2020 header.b=SdVyRBum; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=PEEfJcgZ; 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=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233940AbhFRIse (ORCPT + 99 others); Fri, 18 Jun 2021 04:48:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233909AbhFRIsR (ORCPT ); Fri, 18 Jun 2021 04:48:17 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B4B0FC061760; Fri, 18 Jun 2021 01:46:08 -0700 (PDT) Date: Fri, 18 Jun 2021 08:46:06 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1624005967; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ohcrc38O26Lfr2W3uV2igtbJnbPRi35ZDw36F/4nYKg=; b=SdVyRBumYjaOJX2rZEJpF/4w/20uxkec0cvG2Q9udTNgI458+vuqB/J3GDLZ8UyUltpvoG JIfFhmg95IxjjlQmGtBHED5ykU/JQuE2L6b1ic7CYoGrdofrpL3YuDzmqleKanQNeqMlfQ SNueQN6f87N0Di4kKHX2v24GByH3sRetlhqNp6LXRhGsGIKMtzhQGF/402aVv3OwMFUBUm y5LwQn+8t/3Ie7sk+ZX6bx+O801Yd7J7r2hYyLIiRlRHSeMcax8yh8xg0QsuK0vlSpJeIC VwhOiS4LHQlIsnRLJWVf1CTlGCA6fRngAA0pfrqi1Tj4CqythHH74Szg0BCfpQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1624005967; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ohcrc38O26Lfr2W3uV2igtbJnbPRi35ZDw36F/4nYKg=; b=PEEfJcgZ1XTey+HT73DuHMLSos+/GLEgcRWnHGLxRBSqcP1g/SAghFlZCpOmI3bo3XMVEQ VCNRK5wALNRhdWAQ== From: "tip-bot2 for Lukasz Luba" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: sched/core] thermal/cpufreq_cooling: Update offline CPUs per-cpu thermal_pressure Cc: Lukasz Luba , "Peter Zijlstra (Intel)" , Viresh Kumar , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20210614191030.22241-1-lukasz.luba@arm.com> References: <20210614191030.22241-1-lukasz.luba@arm.com> MIME-Version: 1.0 Message-ID: <162400596666.19906.7832650619393639498.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the sched/core branch of tip: Commit-ID: 2ad8ccc17d1e4270cf65a3f2a07a7534aa23e3fb Gitweb: https://git.kernel.org/tip/2ad8ccc17d1e4270cf65a3f2a07a7534aa23e3fb Author: Lukasz Luba AuthorDate: Mon, 14 Jun 2021 20:10:30 +01:00 Committer: Peter Zijlstra CommitterDate: Thu, 17 Jun 2021 14:11:43 +02:00 thermal/cpufreq_cooling: Update offline CPUs per-cpu thermal_pressure 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 thermal framework sets capping. Fixes: f12e4f66ab6a3 ("thermal/cpu-cooling: Update thermal pressure in case of a maximum frequency capping") Signed-off-by: Lukasz Luba Signed-off-by: Peter Zijlstra (Intel) Acked-by: Viresh Kumar Link: https://lore.kernel.org/r/20210614191030.22241-1-lukasz.luba@arm.com --- drivers/thermal/cpufreq_cooling.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/thermal/cpufreq_cooling.c b/drivers/thermal/cpufreq_cooling.c index eeb4e4b..43b1ae8 100644 --- a/drivers/thermal/cpufreq_cooling.c +++ b/drivers/thermal/cpufreq_cooling.c @@ -478,7 +478,7 @@ static int cpufreq_set_cur_state(struct thermal_cooling_device *cdev, ret = freq_qos_update_request(&cpufreq_cdev->qos_req, frequency); if (ret >= 0) { cpufreq_cdev->cpufreq_state = state; - cpus = cpufreq_cdev->policy->cpus; + cpus = cpufreq_cdev->policy->related_cpus; max_capacity = arch_scale_cpu_capacity(cpumask_first(cpus)); capacity = frequency * max_capacity; capacity /= cpufreq_cdev->policy->cpuinfo.max_freq;