Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp870840ybf; Thu, 27 Feb 2020 01:03:31 -0800 (PST) X-Google-Smtp-Source: APXvYqxdl3sN3iJbTYRifek5oGki0de+sYmxgw8pbKRLWeGabDl6uhtv4GA18ZUv07PU5CbstqdD X-Received: by 2002:aca:3354:: with SMTP id z81mr2488680oiz.129.1582794211779; Thu, 27 Feb 2020 01:03:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582794211; cv=none; d=google.com; s=arc-20160816; b=do5QS2HJ1kMPm6g7u8Sfkle1vvcX6/cU9YPQWvz7wB4gmXZgGTe3CPLGQhPSmYul7Z ar4PByxBQjKziWfPUlz6E0hpvJu+EUaA4i/kq85t28n6fcB7ybUIjPWvzxH9iquCV0HD utUD3Uu7OD9wXsfSVOUpchR2T7zi0bOiE1LvAFZk8BHZ/f3pjw1bcqdc1A7qNMBCor0V 3BLf6KMIZGdqH1ZiU3IDbZoOQhd/Waz44rrCkRfVMZL8Q2Rvm6VSEEYxHKc60sxgT6XZ S0AkCFqDxiGtI3G8C6IvoKF1QqsQ+Q8hrD48Sm/Ro/g6+2VHs9y8Ip6JmJn2rpsIeoqN iVuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=xlBXz/I3y1DVeHcgLwW/RjYI7dU6kY1tZBKMT3/lG1E=; b=yWHiTRIf9tCkNIbKDOVL/wKfniZf4LXO0kLfyxf1c2kVSumiZN3mlzvB70ua5JEQ3e RMVnNyvJmYBWUjFKQtxdwLY8NGCsa2SO3FPLxuh0UFbr7QnNk0ZF9jnz1Wyj05SwpDg6 0WCNUbfxccVLTH1h2hmGm/yiotqjUCSa5dHuaVdIf+kThExK5ZF+DNSX5rL+HhVdy6o3 n33+mmxztUkAWNa278yc/RPKvqMjoaWEzDFKkMvKYUmBRXdb8erHcDG7BP/2Jt/R1drx GpOaqn/JAm6mESTZl/M36v10iKDd8w63vRNUMfxLPY+vtLoXMGqVTAq4AaRHULdqnVai NPkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@verdurent-com.20150623.gappssmtp.com header.s=20150623 header.b=LE+vE3N3; 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 9si923599oir.71.2020.02.27.01.03.19; Thu, 27 Feb 2020 01:03:31 -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=@verdurent-com.20150623.gappssmtp.com header.s=20150623 header.b=LE+vE3N3; 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 S1728748AbgB0JDP (ORCPT + 99 others); Thu, 27 Feb 2020 04:03:15 -0500 Received: from mail-vk1-f193.google.com ([209.85.221.193]:44680 "EHLO mail-vk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728464AbgB0JDO (ORCPT ); Thu, 27 Feb 2020 04:03:14 -0500 Received: by mail-vk1-f193.google.com with SMTP id x62so513027vkg.11 for ; Thu, 27 Feb 2020 01:03:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=verdurent-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=xlBXz/I3y1DVeHcgLwW/RjYI7dU6kY1tZBKMT3/lG1E=; b=LE+vE3N3S+gbAaAfC3Vfv+H9+noQ20DPexyV4aaqLuiY4PpXFfEsCJc5aH+gZfzmpa i4v4NvRggZMtHweKbDYdnWASzvLok+G0TVSNJ6CQUC+4Klw+/fpQ3aBO0DdUerubSjGB mZSH0p6/3LXLuH7LzxFE1VHUA9nrHdU6Axn95gljr8Lcjq2lvV9NGIkSPg7CLGxxgJ+w Wy+d7HE2dcI1FIBYgveCcej6Z6wQzBVoNKg0XkUvujt3iiqktKjDgLqd36xF1hSAxufi Tj4t8lsOqMAl/Q84F9CBh1AoHJ0LmefhX8R8v9DU7OxRpRtf/p3sxHUcWi0Cvi1fZ3ul blMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=xlBXz/I3y1DVeHcgLwW/RjYI7dU6kY1tZBKMT3/lG1E=; b=qa9UD38jLEZ2yG0u79bDlbynbqLxwe+BjF3Yzsi8PaSRqMp47f9cW+RBxBrZbYFa3S zatXX7tqcaxrOX9zJEtLp88OurMe0LZcOwYWofWx8Ru1FaEc2OxHRo2oaDs1HzSCi0Dl nMh86sDqOxCzjnJdfxvtkobv1gl3+LL/kpvxQo3tORNIYZ9pEamV/P4C7esrUswEN4ke W/37YvzI7Z6AECS3pzueXmjPtUmQXSsf4YcwYjm/fl5Lz3UGPdmKF6kVUWR9+NUNFHdl GBYopXwavHCBc5Kowli2W7gv182mFLlY/qIFh4+DRO2Dh0JtIbCIAHMLJxZ2FGnjA1L0 qUSg== X-Gm-Message-State: APjAAAV8lj0gqEa82HAYrnym7uR6lydBBsIMOh7RRcXdxii5er19QzDY wmhFtWIB9vI4BmaXxaYEvFei2RzsFfis04xEnak1cg== X-Received: by 2002:ac5:c7a9:: with SMTP id d9mr2057624vkn.79.1582794192622; Thu, 27 Feb 2020 01:03:12 -0800 (PST) MIME-Version: 1.0 References: <20200222005213.3873-1-thara.gopinath@linaro.org> <20200222005213.3873-7-thara.gopinath@linaro.org> In-Reply-To: <20200222005213.3873-7-thara.gopinath@linaro.org> From: Amit Kucheria Date: Thu, 27 Feb 2020 14:33:01 +0530 Message-ID: Subject: Re: [Patch v10 6/9] sched/fair: Enable periodic update of average thermal pressure To: Thara Gopinath Cc: Ingo Molnar , Peter Zijlstra , ionela.voinescu@arm.com, Vincent Guittot , Dietmar Eggemann , Zhang Rui , qperret@google.com, Daniel Lezcano , Viresh Kumar , Steven Rostedt , Will Deacon , Catalin Marinas , Sudeep Holla , Juri Lelli , Jonathan Corbet , LKML , Amit Daniel Kachhap , Javi Merino Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Feb 22, 2020 at 6:22 AM Thara Gopinath wrote: > > Introduce support in scheduler periodic tick and other CFS bookkeeping > apis to trigger the process of computing average thermal pressure for a > cpu. Also consider avg_thermal.load_avg in others_have_blocked which > allows for decay of pelt signals. > > Signed-off-by: Thara Gopinath > --- > v8->v9: > - Moved periodic triggering of thermal pressure averaging from CFS > tick function to generic scheduler core tick function as per > Peter's review comments. > > kernel/sched/core.c | 3 +++ > kernel/sched/fair.c | 7 +++++++ > 2 files changed, 10 insertions(+) Hi Thara, This patch has a fuzz while applying to v5.6-rc2. Just FYI. Regards, Amit > > diff --git a/kernel/sched/core.c b/kernel/sched/core.c > index e94819d573be..160b5e9e8945 100644 > --- a/kernel/sched/core.c > +++ b/kernel/sched/core.c > @@ -3588,6 +3588,7 @@ void scheduler_tick(void) > struct rq *rq = cpu_rq(cpu); > struct task_struct *curr = rq->curr; > struct rq_flags rf; > + unsigned long thermal_pressure; > > arch_scale_freq_tick(); > sched_clock_tick(); > @@ -3595,6 +3596,8 @@ void scheduler_tick(void) > rq_lock(rq, &rf); > > update_rq_clock(rq); > + thermal_pressure = arch_scale_thermal_pressure(cpu_of(rq)); > + update_thermal_load_avg(rq_clock_task(rq), rq, thermal_pressure); > curr->sched_class->task_tick(rq, curr, 0); > calc_global_load_tick(rq); > psi_task_tick(rq); > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > index f38ff5a335d3..00b21a5b71f0 100644 > --- a/kernel/sched/fair.c > +++ b/kernel/sched/fair.c > @@ -7536,6 +7536,9 @@ static inline bool others_have_blocked(struct rq *rq) > if (READ_ONCE(rq->avg_dl.util_avg)) > return true; > > + if (thermal_load_avg(rq)) > + return true; > + > #ifdef CONFIG_HAVE_SCHED_AVG_IRQ > if (READ_ONCE(rq->avg_irq.util_avg)) > return true; > @@ -7561,6 +7564,7 @@ static bool __update_blocked_others(struct rq *rq, bool *done) > { > const struct sched_class *curr_class; > u64 now = rq_clock_pelt(rq); > + unsigned long thermal_pressure; > bool decayed; > > /* > @@ -7569,8 +7573,11 @@ static bool __update_blocked_others(struct rq *rq, bool *done) > */ > curr_class = rq->curr->sched_class; > > + thermal_pressure = arch_scale_thermal_pressure(cpu_of(rq)); > + > decayed = update_rt_rq_load_avg(now, rq, curr_class == &rt_sched_class) | > update_dl_rq_load_avg(now, rq, curr_class == &dl_sched_class) | > + update_thermal_load_avg(rq_clock_task(rq), rq, thermal_pressure) | > update_irq_load_avg(rq, 0); > > if (others_have_blocked(rq)) > -- > 2.20.1 >