From patchwork Tue Nov 5 18:49:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thara Gopinath X-Patchwork-Id: 178551 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp1151920ilf; Tue, 5 Nov 2019 10:50:29 -0800 (PST) X-Google-Smtp-Source: APXvYqxHs/3pbYdK1N0qH8MPl6bSsgYwsUQcywzQU8xgpe0zAuUkmUwvFy0byWgeD0qSMuGMQ5tT X-Received: by 2002:a17:906:378d:: with SMTP id n13mr25294882ejc.260.1572979799629; Tue, 05 Nov 2019 10:49:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572979799; cv=none; d=google.com; s=arc-20160816; b=Ks9fe29F8rqDAg4WCg6pEwQ9eEHUQVJD4fpJ71DNYT4DFras10x1qtCK3cTIkMDCe1 0EjDe1ekhuCVDPAIkBbadP7G1QQEtISCcpkePtZ7bQNvz0FPs7YZFu/4ooGvX47btoNR wmQORpnjPwUnG3Wy6zOa/M3+qUqHoxmrkF+Q/GX9a69knjeYievGkmvCDJ/jNJE84AtQ EGeF6xgkGHSKtpuOkYXR9ulz9juxKyqRgXY6VoHO13RCtDaei0QqpJXYAL7vFgod9+JC qFDq9XA/ZbU1QYZsj2cr3e4dYtSzKPw8NdIzKDqrg9QUe/1xzQQrc+6FsExA0gTTuEXA p3Xg== 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=CdRdyYtCwsA++AMEix7betRB8SrDMfU5EHHNK7KWNOQ=; b=RyQ8XootQx8MhuQuLEdoM+zOuv+l5wjlkIot9Aqe+QKs07JMyhpddc8vAWnhmidOh4 z239v/M0gGRf1m9WwjynUGwiFfopchGVQoPGz12Q2xiDK+dwbEc9uiE79xk+77bcp8PL 6tGTf2gxcGZ/hF5aOgd2HyAHojoZLc+XKzqdv4E14scsb6y6//yvUNoKDpj3PasCQ3vm uEprvh9VEuYPonwXwZBjnct/5gEK1L8tisX3YMhwtVzFLaNJpk7F5zyKA0k+4oPvHMjv 4OlszyDiBX+Q0kfQm6MlJPwqMmwjOW60FV+3uVz8jOkv2ke2v3jBeBGMGUQZAD8byoUd wk1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fy5bE7t9; 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 nj2si13921473ejb.233.2019.11.05.10.49.59; Tue, 05 Nov 2019 10:49:59 -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=fy5bE7t9; 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 S2390829AbfKESt4 (ORCPT + 26 others); Tue, 5 Nov 2019 13:49:56 -0500 Received: from mail-qk1-f194.google.com ([209.85.222.194]:38411 "EHLO mail-qk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390813AbfKESty (ORCPT ); Tue, 5 Nov 2019 13:49:54 -0500 Received: by mail-qk1-f194.google.com with SMTP id e2so22138244qkn.5 for ; Tue, 05 Nov 2019 10:49:53 -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=CdRdyYtCwsA++AMEix7betRB8SrDMfU5EHHNK7KWNOQ=; b=fy5bE7t9ATgU8+i9GK9xokBHTF6uuDjJlM/lV6EfNTFyMxa3Uq2ybhKNeWFBvr+Wah 7FDsjBEMqE2RhsL08x7wrmIeAVYlhp9MBctEW93FbdU2hPIvL27CMWE6Q5tjq1uwUPF+ REzgCZ1kmRLRxjB/z2Bn9HHYThkP5adqWMYfnakhGXSnzfl40swpthivf3y3cp+X6jIq ffbMdRSUzIsLm0IYqCAr9aoa36mBtr9p+/lWWiLX6DjMCw6eRHcj+5dpnuDSONP2Lyhy g6aICWCCkW1otiiQ4H4DyhnCaaHsDNOwND3HfFj/gLfymWcSBrt+BYfIwmSDdzkabY8H AoNw== 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=CdRdyYtCwsA++AMEix7betRB8SrDMfU5EHHNK7KWNOQ=; b=DBBJCY78qYhUEDzd+4iTt9QMZc9re4Q42r/CJW5ppKnwKv1eEiIknI1Hl5gJAtP7lF jxHgAcJfLqg1PwFtWqsKb0Mp1+3xOnlcHl4gHlVA2ec/avqpsDF9vTQJIfi5yqrBO0sF 296U+iRL9CfhKy3D+fM36Cv1zLgpEx3vK5pPZ0qdh7AglKheZWX6dW1+absg1tdU0YgQ UJTMP6Kxi1vybxQVJb/bRo5WNCTQZPtZlsxMqKBxk8VCdTIGA9q+EH7v+YsDcnkMV2cV vBUZIG21SwxCAaTXbsz2JhxnA8jFa3qXn2vJK/x6toW7XwawKbIl95S+NZuH4V0uKonM eutw== X-Gm-Message-State: APjAAAU7SeRPmfowV2U94OQYeJ/RqhpFf52SFBdOdo0IFZgxzm5sOQxY xI+O8RD00DV4cAt5iw1TcD3tPQ== X-Received: by 2002:a37:6704:: with SMTP id b4mr22831264qkc.23.1572979793405; Tue, 05 Nov 2019 10:49:53 -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 j7sm6832565qkd.46.2019.11.05.10.49.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 05 Nov 2019 10:49:52 -0800 (PST) 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 v5 4/6] sched/fair: update cpu_capcity to reflect thermal pressure Date: Tue, 5 Nov 2019 13:49:44 -0500 Message-Id: <1572979786-20361-5-git-send-email-thara.gopinath@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1572979786-20361-1-git-send-email-thara.gopinath@linaro.org> References: <1572979786-20361-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. Other signals that are deducted from cpu_capacity to reflect the actual capacity available are rt and dl util_avg. util_avg tracks a binary signal and uses the weights 1024 and 0. Whereas thermal pressure is tracked using load_avg. load_avg uses the actual "delta" capacity as the weight. Signed-off-by: Thara Gopinath --- kernel/sched/fair.c | 1 + 1 file changed, 1 insertion(+) -- 2.1.4 diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 9fb0494..5f6c371 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -7738,6 +7738,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;