Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp1133002ybx; Tue, 5 Nov 2019 10:54:36 -0800 (PST) X-Google-Smtp-Source: APXvYqyfCBLKkeZlVLZ9ApQMxkgzxN0QqN8AC2iWBjyLGJBhrjZdmHJZD9bFDfqBfkTfRP/dxDwj X-Received: by 2002:a17:907:2122:: with SMTP id qo2mr19741498ejb.12.1572980076695; Tue, 05 Nov 2019 10:54:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572980076; cv=none; d=google.com; s=arc-20160816; b=QTNXYj0ilqY55cgEnmoo1+UuXV+zwo56WidcqKN5xPJ3ArYV/lJqY1s4Fqt0tvUsyo 5gY0YcjS1GhFzqI143TUc/cmBX3P7WAhZcOTixXZ12LXkEJjMK90lW9XbgmoqI4Vwqg8 xniy/WpHKaD6DuC6fkMLtU7KLtUp8+vZBELjZ7g+tO2Epi+YP0OnR1Ua49m7jJrgPL39 3UBh6FxlUCoiUkEkXIii/0IhblXR3wn7PpFZgS6geTSVn8JU43CUTeumohw9tyorLGEe u97U8k3fi4zRbJKHDGgNEqfAilVk+WjsXhTAPEaQkxtMncRXo1mzkITlOg8iqwApJ4sR +q0w== 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 a3si10575355edb.134.2019.11.05.10.53.42; Tue, 05 Nov 2019 10:54:36 -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 S2390823AbfKEStz (ORCPT + 99 others); Tue, 5 Nov 2019 13:49:55 -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(+) 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; -- 2.1.4