Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp830527ybx; Wed, 6 Nov 2019 09:03:21 -0800 (PST) X-Google-Smtp-Source: APXvYqzEsFdeXhmcwLPVDR69W43OMSynyDlXESU3mDOaF3AWZjJVhrW7sqlFnVqxpp2aRfCbPq88 X-Received: by 2002:a05:6402:70e:: with SMTP id w14mr3794886edx.95.1573059801169; Wed, 06 Nov 2019 09:03:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573059801; cv=none; d=google.com; s=arc-20160816; b=yRZW8BAzIcMslz/DSYgSwDlMFHrSU8R+O9u2+b78L94J9nHOB5UYdfnKzXs12qoM73 0gxajgJ+RjAApnnvxrcxHFibxx+jUeJJqWe8fzAgqUNcqpgM6X1v5UaufP3+N1p48VjY iUEDErsf4YjW/46RI2h1rW6wCdaIvLMrwNxwW/j9+2mfwdR7bKDXEV2pXYgcvRLVfjyi 9kkbKm1C57wc8MaZOh1NB2rBWQo9zRvJU/LQwolSaKC6jyinGkNKN/J6nzr3c+uKQpFi PPgnyzeLXpIVbgA7rMwOkYC6MHgTW2tjl4Frg2yCqx+F3szaGJDN5mqQmMZzMdHxIDL4 hiwg== 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:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject:dkim-signature; bh=f9JEJF8J30F6bEwR2z5GiLYIZMgrUBUBcnr060ZsYj8=; b=QIBMddlDmcR+JOJBPiRRQbkVPeRM2JnjKQqJHlu+9+sKYRtYFSiVXs/u4v1V3fOLVD ks61h44quVFUq9DtOHNq1UNnrXpqm+2n4uaFdVN82P8nTfUGsgC8N8nMeSYfEv0yuy1G zyz+YQDGTyfoEtWOhe00vn4xoESDmVHEoQznK9wMtVGhDCORVxpAIJQliUrwlFjP/ALu ABqxE9nsOqru8d9COLbiThbcMyE/+w6+mDMebo/iept8UuHqimvHlxiXsYEN5ha414Mp zYg+kH3i2AMB0Yzbk1w6sV5jCxSWWOWt38kClAQeDkDo/AIofCy3EnZy4XU+tiLCPb8W CDOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=v8OF4tYV; 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 e58si12564067eda.7.2019.11.06.09.02.54; Wed, 06 Nov 2019 09:03:21 -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=v8OF4tYV; 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 S1732302AbfKFRAE (ORCPT + 99 others); Wed, 6 Nov 2019 12:00:04 -0500 Received: from mail-qv1-f68.google.com ([209.85.219.68]:38646 "EHLO mail-qv1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727894AbfKFRAE (ORCPT ); Wed, 6 Nov 2019 12:00:04 -0500 Received: by mail-qv1-f68.google.com with SMTP id q19so1705966qvs.5 for ; Wed, 06 Nov 2019 09:00:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=f9JEJF8J30F6bEwR2z5GiLYIZMgrUBUBcnr060ZsYj8=; b=v8OF4tYV+Z4Y+PD1DD+clPtnE9GHzDE9nhpNXvcpbiNpPZMH10DGKybwHWLgqkXZCZ 5WblIwwioX25bpjjteUjcH4GsBo9ajH7NRL4Esz/BYoZakUyZR1r80o4fC3ReIcftbYt UPPhZdUfBl/7BMPLANAqkHlfxjsV1JoJFSO++cfCZlJrtgvBamyPkCSypqdgOU0FtYMW pWlbNeVB+D2lUjvm3Vmzdc65yhk7/ilTkN3lYC/MuXGuhlqWSBKTjj604mDCrLrzH3K0 VRN3e9Zztjefjq6PIO8F7g5QMUvS1PxVQHyOWWtaH7+BA2+UVfabhhdt4+WAza8b06ar dHsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=f9JEJF8J30F6bEwR2z5GiLYIZMgrUBUBcnr060ZsYj8=; b=gIiebKX72N6KiI8YcyUmmLtClQgmGbDJc2OpG9jzUFXmjbMeVDpv/3ang5vOyKS1rJ VC7AUpZH6u8sOe9NYb0j/+UpKUZ6DcgMjpySYRO8QzHo7RfPgJpx9yPU9VtBf8Oo7x6k s6sC6CVH/gOgx0GGgY/Z2Z8CnX/CmrTAXjKJFkRNar4fOnqoGjORyx1Shz+t3CgfL1AE oeDwgFc+TpUFzhnQRFGy8YOksxbBqeQxEkTKiArkBFwB+XSN3mPJmBnWqcFSx5MM9lg5 VxHrOlwWjJCx5jtGOhNpPB9xEAjRlaeEdJa6sAYQnhfKsslOccZwPdw/JIbwbHhhI2QW ab/g== X-Gm-Message-State: APjAAAV84P6hMLfL41sTQ8BKx/Pr19KSzE8twb2TC49dhhQD86l0852N cf/22Lqm7RlrQe18Xy1xq+cx/w== X-Received: by 2002:a0c:fde8:: with SMTP id m8mr3273122qvu.4.1573059602637; Wed, 06 Nov 2019 09:00:02 -0800 (PST) Received: from [192.168.1.169] (pool-71-255-246-27.washdc.fios.verizon.net. [71.255.246.27]) by smtp.gmail.com with ESMTPSA id u7sm12650106qkm.127.2019.11.06.09.00.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Nov 2019 09:00:01 -0800 (PST) Subject: Re: [Patch v5 1/6] sched/pelt.c: Add support to track thermal pressure To: Dietmar Eggemann , mingo@redhat.com, peterz@infradead.org, ionela.voinescu@arm.com, vincent.guittot@linaro.org, rui.zhang@intel.com, edubezval@gmail.com, qperret@google.com References: <1572979786-20361-1-git-send-email-thara.gopinath@linaro.org> <1572979786-20361-2-git-send-email-thara.gopinath@linaro.org> <6e2b2a11-834d-a0ee-a386-1edc624a8050@arm.com> Cc: linux-kernel@vger.kernel.org, amit.kachhap@gmail.com, javi.merino@kernel.org, daniel.lezcano@linaro.org From: Thara Gopinath Message-ID: <5DC2FC10.3080102@linaro.org> Date: Wed, 6 Nov 2019 12:00:00 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <6e2b2a11-834d-a0ee-a386-1edc624a8050@arm.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Dietmar, Thanks for the review. On 11/06/2019 07:50 AM, Dietmar Eggemann wrote: > 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. Will put a function header and update the nits above. > >> +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; >> +} >> + > > [...] > -- Warm Regards Thara