Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp1022607ybp; Thu, 17 Oct 2019 07:01:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqwh2DhzkKc9/m13fc1WsmwMjTE/ak4bvV500XJtTwnFMSykwgCzTcPwqM5LW6yV+VRvuEhc X-Received: by 2002:aa7:c70d:: with SMTP id i13mr3929768edq.214.1571320874379; Thu, 17 Oct 2019 07:01:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571320874; cv=none; d=google.com; s=arc-20160816; b=UbbhPY1pauUkQQPXeaec7ZTJ9/Np+sha1p98vD7M3SaR7hlZmKyvwlNntziV9RQbq5 dvBIgWrmP7ZP/EcTGmtRBOiS1SD0gOxm2R3CW5rbEeWt2JTMyQjKc6GfpQsiqEj0K+FK vvvwyw0cnTR/miptL1fE0MOqVRYgNZGleYGvPeI3XQNq0VNkrEUVskTR4grQ8TjTcX60 VuPSq3ov5YbizaLZbm3tpC2PxcDTYaXVVfQB76lFsy1XpkjUGSuv+Pd9MTpLC/Kn2/7m oEbqd1LUor1sLoV+IUmO023Y2urqPIFVA8u0k9lgG34OletJeBXeTP6irQcKGFlATWXb 2suQ== 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=Rq3sgQ4yogwO7Q9sdE9u/UpAfUNvEMK3KFs6N0a+tLY=; b=d3IkkGhdjAhgpikuRB/M866JNQcVH6PJ3J95Pv1X5HP+mFWTKFKr/fRSIb9hqyYvuz S5qGjjQ6pHX1+TT8R6El2M1SJMC/bLzOP+yScl/Zc6TU7FZvXqVFsMm8CihnlFqQA9L4 C2e7xw19DWU8q0hZbErUGuvfgs3XpS2OWRxyDsRBFTYnW3nDKjXzqhesnPcJTdjtAdg7 cbGDOXpFwDrtA5g5us9B9ZIg3ja1OWeyF/kWvIX4l95TqyVb1J9oaLkBCKBRA2HAUPNO hu5l/s3hthRKVDXqbmef/HPylEayjRGc3D/yvrFq5mz+Rr5Doggy8Or6YhVL86HiYnP5 mrnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RC11To3H; 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 be24si1530483edb.120.2019.10.17.07.00.49; Thu, 17 Oct 2019 07:01:14 -0700 (PDT) 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=RC11To3H; 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 S2437467AbfJPVQA (ORCPT + 99 others); Wed, 16 Oct 2019 17:16:00 -0400 Received: from mail-qk1-f196.google.com ([209.85.222.196]:46647 "EHLO mail-qk1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727542AbfJPVQA (ORCPT ); Wed, 16 Oct 2019 17:16:00 -0400 Received: by mail-qk1-f196.google.com with SMTP id e66so3637355qkf.13 for ; Wed, 16 Oct 2019 14:15:59 -0700 (PDT) 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=Rq3sgQ4yogwO7Q9sdE9u/UpAfUNvEMK3KFs6N0a+tLY=; b=RC11To3HQPJ/oUt4Z02+stsI0U8K4IzLRyheQ68o5WVIOgpghrWlV1q4PFJmbsESFq b5RnUFzL2MGMpwsWgWGUtUnH/uW4dWEYWWrk8cQgPJAkzGxjGLOqyYN9Wbf0o0wLwJGX uKp3okx11o4m049sQHIqjIY04gFd73eP0N7yzZ/x/otpS2287zj3H/mUOyuOH+DaG1s3 gudR7b/D1fzyPZrYimeHlhLwZZIrMIf5OWTax89FCgq/F5THbHaFzNu9GBw2IkX8cGDj +Qbzhk74nYxJbcczHVPA+NbUkrDJkVFJYctQWGe0Qh4umVxo5OfUsgpyVJX1EdIyiQfC 4D0A== 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=Rq3sgQ4yogwO7Q9sdE9u/UpAfUNvEMK3KFs6N0a+tLY=; b=n40E3JWoitcqBfUxzqLLDzhH8dgkMJ4DsiugxkT68C/7dfBeJ6fFtFgUrA5y29rSMU nkhBuTvzxM8USfmUdzv5to89QODn+wjkchCCZGiLzcsMYj0AvEd1xrQxg/+he9LxwjeR NTsWcWFgdmBA4dxH5lQ+XdH4xcsLWNKIEMt5Hilimvepz+R0QCGWoe/P8RATjRqNe0w2 OhlVTxLyTJDl3niaWoSkQzhjhMFj29/nKze2LzNYpr8upJu6KbUq0KoUzIOhLRW0Vgdz zalXy2m+jn15RvZA7uRGuHwaUFBHnQ+AOS1YV9kOPsm5RDswjr9SJT/kSEGNNP/LDN10 CMDQ== X-Gm-Message-State: APjAAAXqooUAT74inJzLcWpvz8MhkOS2iQaNKX3MIJsqg4edmy62aXEM UHKkjduDWtk5MVqN4j/OlrHJpQ== X-Received: by 2002:a37:a345:: with SMTP id m66mr5652964qke.487.1571260558980; Wed, 16 Oct 2019 14:15:58 -0700 (PDT) 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 e13sm35111qkm.110.2019.10.16.14.15.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Oct 2019 14:15:58 -0700 (PDT) Subject: Re: [Patch v3 1/7] sched/pelt.c: Add support to track thermal pressure To: Vincent Guittot References: <1571014705-19646-1-git-send-email-thara.gopinath@linaro.org> <1571014705-19646-2-git-send-email-thara.gopinath@linaro.org> Cc: Ingo Molnar , Peter Zijlstra , Ionela Voinescu , Zhang Rui , Eduardo Valentin , linux-kernel , Amit Kachhap , Javi Merino , Daniel Lezcano From: Thara Gopinath Message-ID: <5DA7888C.3050406@linaro.org> Date: Wed, 16 Oct 2019 17:15:56 -0400 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: 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 Vincent, Thanks for the review. On 10/14/2019 09:55 AM, Vincent Guittot wrote: > Hi Thara, > > On Mon, 14 Oct 2019 at 02:58, Thara Gopinath wrote: >> >> Extrapolating on the exisitng framework to track rt/dl utilization using > > s/exisitng/existing/ > >> pelt signals, add a similar mechanism to track thermal pressue. The > > s/pessure/pressure/ Will fix all the typo. > >> 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. > > It would be good to mention why you use load_avg field instead of > util_avg field: because the signal is weighted with the capped > capacity and is not binary > And also explained a bit what capacity refer to > >> In order to track average thermal pressure, a new sched_avg variable >> avg_thermal is introduced. Function update_thermal_avg can be called >> to do the periodic bookeeping (accumulate, decay and average) >> 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..f06aae3 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; >> } >> >> +int update_thermal_avg(u64 now, struct rq *rq, u64 capacity) > > All the other functions are named : > update_cfs_rq/rt_rq/dl_rq/irq_load_avg > > might be good to keep similar name with update_thermal_load_avg Sure. Will rename the function. > >> +{ >> + if (___update_load_sum(now, &rq->avg_thermal, >> + capacity, >> + capacity, >> + capacity)) { >> + ___update_load_avg(&rq->avg_thermal, 1, 1); >> + return 1; >> + } >> + >> + return 0; >> +} >> + >> #ifdef CONFIG_HAVE_SCHED_AVG_IRQ >> /* >> * irq: >> diff --git a/kernel/sched/pelt.h b/kernel/sched/pelt.h >> index afff644..01c5436 100644 >> --- a/kernel/sched/pelt.h >> +++ b/kernel/sched/pelt.h >> @@ -6,6 +6,7 @@ int __update_load_avg_se(u64 now, struct cfs_rq *cfs_rq, struct sched_entity *se >> int __update_load_avg_cfs_rq(u64 now, struct cfs_rq *cfs_rq); >> int update_rt_rq_load_avg(u64 now, struct rq *rq, int running); >> int update_dl_rq_load_avg(u64 now, struct rq *rq, int running); >> +int update_thermal_avg(u64 now, struct rq *rq, u64 capacity); >> >> #ifdef CONFIG_HAVE_SCHED_AVG_IRQ >> int update_irq_load_avg(struct rq *rq, u64 running); >> @@ -175,6 +176,12 @@ update_rq_clock_pelt(struct rq *rq, s64 delta) { } >> static inline void >> update_idle_rq_clock_pelt(struct rq *rq) { } >> >> +static inline int > > can you keep some function ordering as above and move > update_thermal_avg() just after update_dl_rq_load_avg will do. Warm Regards Thara