Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp6682516ybl; Mon, 23 Dec 2019 09:53:18 -0800 (PST) X-Google-Smtp-Source: APXvYqyUTEuJroasIAyC9pbxkGFwHZtny81DTeo//lniEGQrNAGFbY23B2FveI5LtRNszVhOxVMf X-Received: by 2002:a05:6830:1501:: with SMTP id k1mr21686418otp.125.1577123598355; Mon, 23 Dec 2019 09:53:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577123598; cv=none; d=google.com; s=arc-20160816; b=pYVSuKkaO6iSaJduf17bWx7j9COruOBZh84zoeCQgKLUvK1XlLeUwlEX3pQPFtxO2R bvl1WFH8xi8FNppEL+rn0Bk6BxuKmZEJrbn0KZz6lxUeX/Xx0628k9AM37EG/htDoc2c ymLxpnlMUn5JHsUm/Q/eBXHxiUb3fZIfAYU35Bw9kBnJqguUhFM7KdmkncpUNtJXXBIJ 7ci/hiakr2eFGfKMNmnDeNyWUN7EYKyFZgCx8fCGoUces1sTfPoUriKk10M+k27yxccP qjdFDcfajgXYDCFq8MptVRhJtJQfJX3KNNKC4fPzKoaS+JEUyE6AxqOqs8sbJZHbKn12 UyWQ== 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=FRS4R9dwBMeS5FxG8a81qwTeTRfFQ1VO1CXt+LPnM6I=; b=gUTzM/FYe71yrl2H2FWw7XbbONYM6dz17fnH9g7s6vJ+kDtRehgDPkBtIOggwetH9u scLCnnreJ7TUiDvt+uQ5bfm8Ux6nuDNPUQpxE8T6vbolowTVOzA7yg3ZKd+mTOSgtkQH JOoQKp1ZJTzG+A5uGeySrobM6RwnSvS07u5eomAOyrHwL/wdU1a3m4FRclE1HU8X9x7/ SH+0jSYVF+mmfnrrSjaZQLmGTkRqqexLbbpa8xgh1/Ee0PI0OuYht72amC5SCU/j7Ai/ SVT4Ny0aeDgCqiTUVXrBzZC/UoPxsg1S4IKJ6lgPV8dZGLMQhaqu0+sfxQA8r+tNowtU mxbA== 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 d63si9133064oif.178.2019.12.23.09.53.06; Mon, 23 Dec 2019 09:53:18 -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 S1726832AbfLWRwQ (ORCPT + 99 others); Mon, 23 Dec 2019 12:52:16 -0500 Received: from foss.arm.com ([217.140.110.172]:47498 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726754AbfLWRwP (ORCPT ); Mon, 23 Dec 2019 12:52:15 -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 10FDF328; Mon, 23 Dec 2019 09:52:15 -0800 (PST) Received: from localhost (e108754-lin.cambridge.arm.com [10.1.198.81]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A70023F68F; Mon, 23 Dec 2019 09:52:14 -0800 (PST) Date: Mon, 23 Dec 2019 17:52:13 +0000 From: Ionela Voinescu To: Thara Gopinath Cc: mingo@redhat.com, peterz@infradead.org, vincent.guittot@linaro.org, rui.zhang@intel.com, qperret@google.com, daniel.lezcano@linaro.org, viresh.kumar@linaro.org, linux-kernel@vger.kernel.org, amit.kachhap@gmail.com, javi.merino@kernel.org, amit.kucheria@verdurent.com Subject: Re: [Patch v6 5/7] sched/fair: update cpu_capacity to reflect thermal pressure Message-ID: <20191223175213.GB31446@arm.com> References: <1576123908-12105-1-git-send-email-thara.gopinath@linaro.org> <1576123908-12105-6-git-send-email-thara.gopinath@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1576123908-12105-6-git-send-email-thara.gopinath@linaro.org> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wednesday 11 Dec 2019 at 23:11:46 (-0500), 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 Maybe we can introduce two terms here: maximum possible capacity and maximum currently available capacity. I think using these two terms the message can become more clear: cpu_capacity initially reflects the maximum possible capacity of a cpu (capacity orig). Thermal pressure on a cpu means this maximum possible capacity of a cpu is not available due to thermal events. This patch subtracts the average thermal pressure for a cpu from the cpu's maximum possible capacity so that cpu_capacity reflects the actual maximum currently available capacity. Kind regards, Ionela. > 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 >