Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp880643ybx; Wed, 6 Nov 2019 09:45:22 -0800 (PST) X-Google-Smtp-Source: APXvYqwM4tsJwdIx+mbiuQ59fPRbX/EzWpKG+tckqYVIsOomrD3GV5ulC6MCQDzi5hYD/gp85DF7 X-Received: by 2002:a50:c408:: with SMTP id v8mr4077376edf.140.1573062322768; Wed, 06 Nov 2019 09:45:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573062322; cv=none; d=google.com; s=arc-20160816; b=l/xKM/NeBEiyTnhdgFIRDPepJCVCJsMe6W+pslz9VUbqsfG2ieAublMWGWfmPASOu8 aEU755SWXXrtKXjafwZ4BwuofJZPU/0jXtDEzxI2iH9gDb2YPzD1jlFtPvuVzJYZbS5s QcoGiTn5BOAQaPtOmb2ZhCwsIKBR2jZ0z44E6K6xiq7phxLN1/PHoraIlVS2Y1nwhj+n B2exrPPU/urwDdGqlO/nWB+dupbVgqdldWsNax/ARsSNllwa+ZHeEYm4sG5x8xx5Nqsl z2GAA3d9Cbo9OE/YllD+UhmDVfDDrc05hiTuxyk61/AV0uqlCjhWK2dh21xNolr63Ti8 eIbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=I18ffVc/rLBGcuJv1wxZNOpJUdpr2y5CJ/EmJ/ANM7o=; b=EVPzf4hvZntknCJZL+fvrXRYnly3HnwjE3Sd+f/ZtvBic+N9EKwXeIhQp3rd7KLrDi zOIBqFpIgA82ny92FOVc71PaMGedMFPUelyxLegI0/G7DPs4X0Lq2u1qmTBVV07+v+Mq Szo3MMCd5CXmh2YiLawWU6RmqdE+nkWsjp+Zzhazl/pKc8cFc5ocOk07K+hbhO/Eo8Re 2vtGrKXBgwfMNqY2O2I3WfsviWFYITWtCC3RgFEP2OVXk+E2dDVdPmQAGlA8u9g8EkGd rJSEo2Iw2pbFpp03zDZdwPIB/d6FiAVzCj1wL+/uY2a3SA7Rg4N7xnyTKwkOTHrkvlv9 J+tA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c29si12560176edb.223.2019.11.06.09.44.58; Wed, 06 Nov 2019 09:45:22 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732290AbfKFRlk (ORCPT + 99 others); Wed, 6 Nov 2019 12:41:40 -0500 Received: from foss.arm.com ([217.140.110.172]:43722 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727286AbfKFRlk (ORCPT ); Wed, 6 Nov 2019 12:41:40 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C0BD246A; Wed, 6 Nov 2019 09:41:39 -0800 (PST) Received: from e107158-lin.cambridge.arm.com (e107158-lin.cambridge.arm.com [10.1.195.21]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 34DA03F719; Wed, 6 Nov 2019 09:41:38 -0800 (PST) Date: Wed, 6 Nov 2019 17:41:35 +0000 From: Qais Yousef To: Thara Gopinath Cc: mingo@redhat.com, peterz@infradead.org, ionela.voinescu@arm.com, vincent.guittot@linaro.org, rui.zhang@intel.com, edubezval@gmail.com, qperret@google.com, linux-kernel@vger.kernel.org, amit.kachhap@gmail.com, javi.merino@kernel.org, daniel.lezcano@linaro.org Subject: Re: [Patch v5 4/6] sched/fair: update cpu_capcity to reflect thermal pressure Message-ID: <20191106174135.gsmnwpwxfarywded@e107158-lin.cambridge.arm.com> References: <1572979786-20361-1-git-send-email-thara.gopinath@linaro.org> <1572979786-20361-5-git-send-email-thara.gopinath@linaro.org> <20191106165646.vc7j4hbhj2hcrku4@e107158-lin.cambridge.arm.com> <5DC30371.1000209@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <5DC30371.1000209@linaro.org> User-Agent: NeoMutt/20171215 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/06/19 12:31, Thara Gopinath wrote: > On 11/06/2019 11:56 AM, Qais Yousef wrote: > > On 11/05/19 13:49, Thara Gopinath wrote: > >> 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. > > > > I think you intended to put this as comment... > > > >> > >> 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); > > > > ... here? > > I did not! But I can. > > > > I find the explanation hard to parse too. Do you think you can rephrase it? > > Something based on what you wrote here would be more understandable IMHO: > > https://lore.kernel.org/lkml/5DBB05BC.40502@linaro.org/ > I will try to rephrase it! I am sorry that you found it hard to parse. > Honestly, I cannot copy paste the code snippet I pointed out to you here > in comment.(And I think that is the reason you found it easier to > understand) But I will try my best to put it in words. No worries. The problem could be me :-) But a comment in the code is very important as util_avg + load_avg is confusing without a comment. I wouldn't expect both signal to be compatible but the thermal one is special. A comment explaining why it's special is all we need. Thanks -- Qais Yousef