Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp546155ybx; Wed, 6 Nov 2019 04:51:26 -0800 (PST) X-Google-Smtp-Source: APXvYqxkPK9T18BMDG1LwaWiC65HN/DthtddVhUAYRf71MY2ERMnEbZUJGVpOP3TqCOoavwP6rOg X-Received: by 2002:a17:906:b310:: with SMTP id n16mr21255019ejz.129.1573044686269; Wed, 06 Nov 2019 04:51:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573044686; cv=none; d=google.com; s=arc-20160816; b=bvUSf5EDT04StCKFika/CRR+muK9GSw/XzAfvxrZvFTEFW9mCZ4+0dsnNGJVoO5R7d PeNslZxwQsHOoRvUzdxcqgXlcXSS04zxGEIcQmRmwr/Cr6w4M4y5HEByBTqT18W3Hcn0 iLUgo+28a16EjZw1TYjoEaW4mThCKja0IkZFIJ2u3wOagZlgbT5VvZjqlmK6gqU0gqZQ +254sjUzk6nwCXMUzNNBxL158gwMYmzNxDJeY7m2CMGGBmWNB59TygmRZhXHhnEExlQS ETqHiipwdkiVkgHDJ99CINDBYkxfeUA6Whe2UnxmuP3K5VCdAbCOySWNevI4gX9LROK1 2IyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=otdVzzVl4uPOyCAA5sc+TsF3t53rjf9DUgTSJOiw8Bs=; b=VfjD4bPsFeXUNTOu/H+bVcNY4oq0LBGXyyVx4qz1JMUyTR0uiJltcKXxUP/rtaOLpf 9iIgQHorpO6nA4ET7rWwJWV7muIPK5L3QsCuh0MslK5UMDHBM7G2I/mRk1SnGmFZvPwG Tm+aM09FySt0VIHsUpAtPW8gkgzFtz2qvmUWUvp5Fv5OCTFN+jcbSBay/WoWQZKwgkZl WzyY7VTKLHr8Y1XHtjTorSniPrHXD1+8mdetYtaa3GjZp2sRgdB6IvWtneYHEXCbf9OQ QoBMKYHDXWV90cUT4dpkR0RRjpKzXDtv3xTesMn8AqVjtpfpVRBfgAeYguPUWfbchI3F LtZA== 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 p5si15851972eja.141.2019.11.06.04.51.02; Wed, 06 Nov 2019 04:51:26 -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 S1730179AbfKFMuZ (ORCPT + 99 others); Wed, 6 Nov 2019 07:50:25 -0500 Received: from foss.arm.com ([217.140.110.172]:39308 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728371AbfKFMuY (ORCPT ); Wed, 6 Nov 2019 07:50:24 -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 2CCA47A7; Wed, 6 Nov 2019 04:50:24 -0800 (PST) Received: from [192.168.0.9] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5C6213F6C4; Wed, 6 Nov 2019 04:50:22 -0800 (PST) Subject: Re: [Patch v5 1/6] sched/pelt.c: Add support to track thermal pressure To: Thara Gopinath , 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 References: <1572979786-20361-1-git-send-email-thara.gopinath@linaro.org> <1572979786-20361-2-git-send-email-thara.gopinath@linaro.org> From: Dietmar Eggemann Message-ID: <6e2b2a11-834d-a0ee-a386-1edc624a8050@arm.com> Date: Wed, 6 Nov 2019 13:50:21 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <1572979786-20361-2-git-send-email-thara.gopinath@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/11/2019 19:49, Thara Gopinath wrote: > Extrapolating on the exisiting framework to track rt/dl utilization using s/exisiting/existing > pelt signals, add a similar mechanism to track thermal pressure. The > difference here from rt/dl utilization tracking is that, instead of > tracking time spent by a cpu running a rt/dl task through util_avg, > the average thermal pressure is tracked through load_avg. This is > because thermal pressure signal is weighted "delta" capacity > and is not binary(util_avg is binary). "delta capacity" here > means delta between the actual capacity of a cpu and the decreased > capacity a cpu due to a thermal event. > In order to track average thermal pressure, a new sched_avg variable > avg_thermal is introduced. Function update_thermal_load_avg can be called > to do the periodic bookeeping (accumulate, decay and average) s/bookeeping/bookkeeping > of the thermal pressure. > > Signed-off-by: Thara Gopinath > --- > kernel/sched/pelt.c | 13 +++++++++++++ > kernel/sched/pelt.h | 7 +++++++ > kernel/sched/sched.h | 1 + > 3 files changed, 21 insertions(+) > > diff --git a/kernel/sched/pelt.c b/kernel/sched/pelt.c > index a96db50..3821069 100644 > --- a/kernel/sched/pelt.c > +++ b/kernel/sched/pelt.c > @@ -353,6 +353,19 @@ int update_dl_rq_load_avg(u64 now, struct rq *rq, int running) > return 0; > } Minor thing: There are function headers for rt_rq, dl_rq and irq. rt_rq even explains that 'load_avg and runnable_load_avg are not supported and meaningless.' Could you do something similar for thermal here? It's not self-explanatory why we track load_avg, runnable_load_avg and util_avg for thermal but only use load_avg. > +int update_thermal_load_avg(u64 now, struct rq *rq, u64 capacity) > +{ > + if (___update_load_sum(now, &rq->avg_thermal, > + capacity, > + capacity, > + capacity)) { > + ___update_load_avg(&rq->avg_thermal, 1, 1); > + return 1; > + } > + > + return 0; > +} > + [...]