Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp361378ybl; Wed, 11 Dec 2019 20:12:59 -0800 (PST) X-Google-Smtp-Source: APXvYqzNIIDWEMjcmtThSkiN4hLKlxCi5jhs+VNsFGdoqCHhY6lifQLfrxiOIBfySgSuq8AoCESU X-Received: by 2002:a05:6830:50:: with SMTP id d16mr6169139otp.155.1576123978915; Wed, 11 Dec 2019 20:12:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576123978; cv=none; d=google.com; s=arc-20160816; b=KsGHesyFFpn018jjmmLyg+IW9hwCfyyKz4mNcy96HuOjN03kky4B4gfDD3rV8QyR6/ BKWqghfVDALB5lCPxFbvaIG3ZE2y3qM8cqhGtfYnA9/pWAwiz/3YQ8+9OJkr3AwvtKFc lWCembu20ti/po0a2BN8EO47ZVQiQUUuLjH63ZLaaBV4/ScriYfC4WrkXbbr8sy6xJKp eKTWXC+YBDZ2IpD8tvQa0FZaI1D5dl/6LpvFnVm7RHbWtBKXauvp4RcgAf8wZW4tuTF5 9zqwQZuSV1hRC1qk1TeBysOSHpXFBJw2cmmCD00oO7e7ZWB5lRcU3HLtCHPxTFk4A7HL U0mw== 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=tCcvIBy4MWkmlTDlVDEp03XcYYwKUTHVbYQuzgTBX4Q=; b=FNC5A2P+BGFCSzOc8thb4iPZMbUR4Z3lNpZOqD6x9ZTwoy6n3gG0xkZkKXqJshc7Yv bhRh6HS8yCszeDvGrHuImoALpI3Y7nIptUxHK/c5jjSS8PhEju2MGKKlZXGC2qmV7Y+o o1hySjgQAs8ji7InX4ayaYRpkzN++rRwta9Tol4nGKtSa0Sptr+HWDgxTTRwtR3i8b2l Jb+YFkCDKsn4/sZ0u7+UANWtQe+iFSq2JcFIjgCYBiIMyG7QvjPOwdrqrcmeMFb8ozUF p9xn13rTNXVl/AcJXrESZPxj4KDPk9GylX75KUp2dqANrO0qF/LFwtrqKh/rYF6VnJwa hrDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ygf5rZfK; 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 d95si2674078otb.258.2019.12.11.20.12.46; Wed, 11 Dec 2019 20:12:58 -0800 (PST) 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=Ygf5rZfK; 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 S1727953AbfLLEMC (ORCPT + 99 others); Wed, 11 Dec 2019 23:12:02 -0500 Received: from mail-qk1-f193.google.com ([209.85.222.193]:44410 "EHLO mail-qk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727894AbfLLEL6 (ORCPT ); Wed, 11 Dec 2019 23:11:58 -0500 Received: by mail-qk1-f193.google.com with SMTP id w127so505950qkb.11 for ; Wed, 11 Dec 2019 20:11:58 -0800 (PST) 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=tCcvIBy4MWkmlTDlVDEp03XcYYwKUTHVbYQuzgTBX4Q=; b=Ygf5rZfKVmn/YQ2uNC2loIbKbXNMF6frWitGn6qeyZ917m19A5o1WHD6CnSKJhwXVt 8vJSDHkWzbBLzSUKqGeWG/6Aj2oHGDxefkxkXVkehkoVlB450eAHBTvOpea/2kPVy+GZ DYZ/+YzXpJ9dkZrto/jov76v5xlJmHVFq3V8gL4JEmDItuwGbp6ciUpPbEYmKv5ClIEW VZxIaaIMoGHDL3ggjAp8iBjSDL1voIUDTrRtLWBZltJja++P/tdMancPKhXQuvsrmZNK bVKm6TGcLsB+E0qVJPb6q48wLx3VFmMq3ymvTXwDvSp6Upz7caAfnpiWP/pJgoCsxZG6 MXiQ== 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=tCcvIBy4MWkmlTDlVDEp03XcYYwKUTHVbYQuzgTBX4Q=; b=GtrLTIj26qxOV0duR5HXYtZiKQJu9tqWit6tZoo4guzOxafzmRRW5/Dkg37Oe3gjIF pCzpcPoOfYfk/jWpDbyhOeQkADHmFhS9oMcw8/HcJCoxGp9/hr9VsjmmWVrhqi3zywyr jPMTjIggvN0h+H/R2DRySTKVMJ4ZClqGXwr+dQQyerAi43WmjpTloNhYA2eiWwZboGdM scJEMZ8A10Z4TWL2bNmTS1wEbdwe2N59sQ+ufPUJGRylbWtsm1LETZzvYxnZ7fSGBARO hlvaomVSVi6O/rQ3GlZ/scS9qEZKIkjBM0uIriyBmIJOBAFrUevVJg3JSsdj9zoCwv8A Nyzw== X-Gm-Message-State: APjAAAV+J0btvFecqzLB9Unqk7nT0P+CWbRZrDJ3+vlPO7GOdXakvChl IlUXjcMEFE/IsS7bk519nkalp0hjmnA= X-Received: by 2002:a37:5d0:: with SMTP id 199mr6226995qkf.131.1576123917716; Wed, 11 Dec 2019 20:11:57 -0800 (PST) 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 s11sm1364126qkg.99.2019.12.11.20.11.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 11 Dec 2019 20:11:56 -0800 (PST) From: Thara Gopinath To: mingo@redhat.com, peterz@infradead.org, ionela.voinescu@arm.com, vincent.guittot@linaro.org, rui.zhang@intel.com, qperret@google.com, daniel.lezcano@linaro.org, viresh.kumar@linaro.org Cc: linux-kernel@vger.kernel.org, amit.kachhap@gmail.com, javi.merino@kernel.org, amit.kucheria@verdurent.com Subject: [Patch v6 5/7] sched/fair: update cpu_capacity to reflect thermal pressure Date: Wed, 11 Dec 2019 23:11:46 -0500 Message-Id: <1576123908-12105-6-git-send-email-thara.gopinath@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1576123908-12105-1-git-send-email-thara.gopinath@linaro.org> References: <1576123908-12105-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 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index e12a375..4840655 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -7725,8 +7725,15 @@ static unsigned long scale_rt_capacity(struct sched_domain *sd, int cpu) if (unlikely(irq >= max)) return 1; + /* + * avg_rt.util avg and avg_dl.util track binary signals + * (running and not running) with weights 0 and 1024 respectively. + * avg_thermal.load_avg tracks thermal pressure and the weighted + * average uses the actual delta max capacity. + */ 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