Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp180378ybg; Tue, 22 Oct 2019 18:25:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqzddnBwMUzMjkmDSBo2M/x8xpNtt6NphgLBC9YDLwa5vwZlHFnC9MFbm6K6MFgr3XUxRmVn X-Received: by 2002:a17:906:fcac:: with SMTP id qw12mr29911884ejb.31.1571793907736; Tue, 22 Oct 2019 18:25:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571793907; cv=none; d=google.com; s=arc-20160816; b=W+lsPFn0oLpfMquC1KT9g3f70mSiInH5tzAGholbgOmJInrvCN5/OKBypIJ7sOqrYW Dr3vhFqNbDxbvL0KpElF01edVQPewkt2RiHrJzUsOYgT4QaEhe9QgmH7cP2BXRSlaDh8 mhwykKDZUXltDlVQA76J/vabrof0y+DladGfsRUBWcYFm4zDKzAPVc4DAbHyfOYzZrmE U5D8L7PgA+q93qDCSN9UnXjRN3U/3hVGRPPmSfgNW5FWKQo9BzFOyAIqmdIr12DQv+fA Al7waWuN9cMsd9grMVfGbqa5SoQQDBhp2Jp7z298FctqI1kZMZDRj3gPlOgWk9gt7KlJ FuiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=701bwJkgXICGE6R4e0XJPVYqMBI43tK0euoxsDFO4As=; b=XaUf00AYgnCOrc3w9wgrBk287Z4yq0V6B8iuRBEZ1kBvRyK9gD7u8Xd1C8Z0/CCA+n 5UyAnE6mf+xRaXyibMU4p0PYIYKOzbtrFEckbnKo1fSFKoNEs4OfQr+weysGMqRPAsCC yMftTwAPKbLTNKI5dkPRGyW5nR9QzVQA9WHF+QGVsyLGnu5o6iRpNJ1AFM1BLpMAObvl fKO9fg0Fa2+CVNr48Jc5eU6OrUmuqWpf+TELT2rcxJp8eMP9oRyyEPb5pYwf2fwicXCY FPtWkOyAmvKX73u4aMtPy0QCF12cehn94ya87+KWvC7K6nyYWbHlRsB0XdcykTK4rysl NXPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LOTbe5dQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id z5si15054952edk.157.2019.10.22.18.24.44; Tue, 22 Oct 2019 18:25:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LOTbe5dQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S2389450AbfJVUei (ORCPT + 99 others); Tue, 22 Oct 2019 16:34:38 -0400 Received: from mail-qt1-f194.google.com ([209.85.160.194]:36324 "EHLO mail-qt1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389421AbfJVUef (ORCPT ); Tue, 22 Oct 2019 16:34:35 -0400 Received: by mail-qt1-f194.google.com with SMTP id d17so14263884qto.3 for ; Tue, 22 Oct 2019 13:34:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=701bwJkgXICGE6R4e0XJPVYqMBI43tK0euoxsDFO4As=; b=LOTbe5dQz9HElq6SSgUYDkeqOyhYlUEiZ3yK9hgo3Hg7ydcyVa1JFpNTOmE5UWnMM/ 98edzR1GiBVZGxYZEWj5XIcdz6Oz2zipi3YWH95sZZcJFoBcomKv74qT8P7vTiLnt4uU oTiGKRusAka7VAY2NosSr1SKyC6rmtpEHAEBlDLNSd47Q5laK7aJXxg1M/l3jm51Aw4b RcvajLgnaHQqN76OJWTuIL+DUP7arPj1p3BZJpUOSUBWJVvEC/4YoFo5OYcJFn8UbJVm rNOdg0CV8CjuI5PRvNg6jUcQXcWPHOvpjXUT+i12cKTzKbkLMQ/S6dDXPDGURzU6zzk0 snnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=701bwJkgXICGE6R4e0XJPVYqMBI43tK0euoxsDFO4As=; b=Q6yxIpWViLTEsXB36nGFGGuFVs+DVc9aNlYzGelN4GT8jM5G8YV4JxoM542VmWwM9s 9p3FthBdQvXWBXPh+FV3A6izUJF19fy3Z+fIsxKpPOK8zShSrLiqZF5YAQDpBfVCtehy 60D6NHZ2FRoICOmalk7aPAS5PuN+aSwG15l/6xwqHxItjXJbcn7H57glkM97rwhhdQ6a s3wrjaVkbpHfAlu4391a9EwkLxCfhQKLgmTU3/1IEvyj3U+z/6HK8cpPdNsxPCrQM/XP dqudXI4Is/qmpqCpq1+QLNmRKqq0GBgXsz8Td8liUQ1dWDiXXPMML975YKgoOmE/Dhkp KYJQ== X-Gm-Message-State: APjAAAXcrn5yAVFTAM+qMpQw4hjZj1GqxxDXRzjwzkCMnNqRAzoolBH+ nUGXLgIG6UkhJQkQV2V0ssQ7dw== X-Received: by 2002:a0c:e6e5:: with SMTP id m5mr5091013qvn.170.1571776474076; Tue, 22 Oct 2019 13:34:34 -0700 (PDT) Received: from Thara-Work-Ubuntu.fios-router.home (pool-71-255-246-27.washdc.fios.verizon.net. [71.255.246.27]) by smtp.googlemail.com with ESMTPSA id r126sm8895038qke.98.2019.10.22.13.34.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 22 Oct 2019 13:34:33 -0700 (PDT) From: Thara Gopinath To: mingo@redhat.com, peterz@infradead.org, ionela.voinescu@arm.com, vincent.guittot@linaro.org, rui.zhang@intel.com, edubezval@gmail.com, qperret@google.com Cc: linux-kernel@vger.kernel.org, amit.kachhap@gmail.com, javi.merino@kernel.org, daniel.lezcano@linaro.org Subject: [Patch v4 4/6] sched/fair: update cpu_capcity to reflect thermal pressure Date: Tue, 22 Oct 2019 16:34:23 -0400 Message-Id: <1571776465-29763-5-git-send-email-thara.gopinath@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1571776465-29763-1-git-send-email-thara.gopinath@linaro.org> References: <1571776465-29763-1-git-send-email-thara.gopinath@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org cpu_capacity relflects the maximum available capacity of a cpu. Thermal pressure on a cpu means this maximum available capacity is reduced. This patch reduces the average thermal pressure for a cpu from its maximum available capacity so that cpu_capacity reflects the actual available capacity. Signed-off-by: Thara Gopinath --- kernel/sched/fair.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 4f9c2cb..be3e802 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -7727,6 +7727,7 @@ static unsigned long scale_rt_capacity(struct sched_domain *sd, int cpu) used = READ_ONCE(rq->avg_rt.util_avg); used += READ_ONCE(rq->avg_dl.util_avg); + used += READ_ONCE(rq->avg_thermal.load_avg); if (unlikely(used >= max)) return 1; -- 2.1.4