Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp9031794ybl; Fri, 17 Jan 2020 05:18:59 -0800 (PST) X-Google-Smtp-Source: APXvYqw1SX3QRYXHpJRmAWVgqwDlI0BTNGdQ/qeGDzu/VJzZy1JN5I0fWkXkzQWhHzUt4MhUMe0I X-Received: by 2002:a05:6808:b15:: with SMTP id s21mr3185173oij.123.1579267139700; Fri, 17 Jan 2020 05:18:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579267139; cv=none; d=google.com; s=arc-20160816; b=pfyt407LTB7ZB9tp+5FH4lDZBys8cVchhxtH5ZqlVjz/3vxIpYLgBF/ok8C4rIQWan OCvAPvbivSoGJ+wDjmLmFnznYS5B/mTWfSMizTXD00+aGw7607A1X9ZQRCvi7nuIriht ZHoc2qO9WIO/3U/GGAD/jfMy9xb/YdTzcbW19fB3/qxA84z9YhwQo9vYN7UoastF6lN/ BN7MiLRzNMOWSiatTZx1GNd/qYIUwtt9Ero/Q0xpdBNFRbL5+Z7yQfBHJYFedj7aiZE9 dfICA6bQg92g58AqWdBgQuONVDQM4S2sCzOO8QuMBiDt3KyvVhqhgOVFNqYtzoFeKUwP Qgyw== 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=q2OChnFdSNqECe+vPEB3C3OvYxdGrVXJ27kI6yMrowk=; b=iY1KTGlqEFGQ7r/DMaZT+RBRxcLkouaSZNbYxJQXOkrf7ut5xfheEx3XZP7MuiPzsR XOL8p8bahc/HSJqpFDEdoGMAzqujM/T6ULarqaF7mRU99DLexsgB1TX5aNqtJ4wd8mYa xP9t+XOty+N70pz9hy4We2/d1V93SXraiS4H/1WANWTEObfhfOm1lxcCBzsv9VE1DiaW IJKGK+0I68LAXmwApBQQNFQcgO4TA9g2dAxtOWSnQwkFnVrneCa5MYfUmRf9DMICouuH 1GmgHKn/Oum7S9Va5mOi8RWdYg9AmUJdkZCbvig2f/qaKbW8oxFKyZXcZo2Cv3NNGOiv OasA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=D6s0DVh+; 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 h128si13273473oif.258.2020.01.17.05.18.47; Fri, 17 Jan 2020 05:18:59 -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=D6s0DVh+; 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 S1727123AbgAQNRu (ORCPT + 99 others); Fri, 17 Jan 2020 08:17:50 -0500 Received: from mail-lf1-f68.google.com ([209.85.167.68]:45415 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726329AbgAQNRu (ORCPT ); Fri, 17 Jan 2020 08:17:50 -0500 Received: by mail-lf1-f68.google.com with SMTP id 203so18304817lfa.12 for ; Fri, 17 Jan 2020 05:17:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=q2OChnFdSNqECe+vPEB3C3OvYxdGrVXJ27kI6yMrowk=; b=D6s0DVh+yENJfQDtTUOPcevVij8PgvbarGgFmoQrjJ6jDX4229Qi6Mt00InzgEWXSQ VwWcLmi8KV5X349Kz7NuZkjwYAMidULL7RzNeul3R/hr8vQu27stJTOh2D/kz5fF2Ea0 BsDvNkFEK57srpr4G0hoIyMSazxVF9tP/H1O/qZzhOW/aPwp5PLgPhddm8Zp8gO6zA8p +utPy/Zamr/forEqwXKp60+veecRrZHA+oHFijf/38svhRXHH1TPiHCLRBCJ94JAmcz7 XL8HwUWCW7KrQmF/A+COYGjR457KO++mGtInK3OMSLwhD0DkXgeKn86QHHnkOVt4g16X g+PA== 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=q2OChnFdSNqECe+vPEB3C3OvYxdGrVXJ27kI6yMrowk=; b=HbJV8hZr65TG1HlpHDEmhc9B+/OnJuTGy+HNv3R/RnScdrMynKI2KXPnefIwLBGKTt X5z7hyYm861SCEm3XNXjqW8RbKCbxLxZC66rENVcXQCa2U7Xk+mmDsdeYJlF1JSEKQyW smOHafnAjwIuUEH9WF/vCQ7FYQNZsl8EftCwibQgFd78mCsrREayTVf4VIa7jS1QUQQ9 rCn0AdS4T3BXi2/7YczCqvvJRCsjTcL2jwOvLfMW0gRDzI+KPC91sMIy6Nlu2TuIh7lR 20q8I6ibvi8SNpMaePYtTwMtZ618P1UY/xq9vnY44Uz+z7b26n7XFAu3ouMaa7ZgT/Xa fiQQ== X-Gm-Message-State: APjAAAUVMmgYZUqRCOgCQdc7JvWaOlIacc1aSJlSTzorWijkrd/mEYVZ HHZWcwf241SHx9E62+qXJlHk07p1WXdNJY+ileWuBw== X-Received: by 2002:ac2:59dd:: with SMTP id x29mr5325027lfn.95.1579267067908; Fri, 17 Jan 2020 05:17:47 -0800 (PST) MIME-Version: 1.0 References: <1579031859-18692-1-git-send-email-thara.gopinath@linaro.org> <1579031859-18692-5-git-send-email-thara.gopinath@linaro.org> <20200116151502.GQ2827@hirez.programming.kicks-ass.net> <20200117114045.GA219309@google.com> <20200117123103.GB14879@hirez.programming.kicks-ass.net> In-Reply-To: <20200117123103.GB14879@hirez.programming.kicks-ass.net> From: Vincent Guittot Date: Fri, 17 Jan 2020 14:17:36 +0100 Message-ID: Subject: Re: [Patch v8 4/7] sched/fair: Enable periodic update of average thermal pressure To: Peter Zijlstra Cc: Quentin Perret , Thara Gopinath , Ingo Molnar , Ionela Voinescu , Dietmar Eggemann , Zhang Rui , Daniel Lezcano , viresh kumar , linux-kernel , Amit Kachhap , Javi Merino , Amit Kucheria , Android Kernel Team 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 Fri, 17 Jan 2020 at 13:31, Peter Zijlstra wrote: > > On Fri, Jan 17, 2020 at 11:40:45AM +0000, Quentin Perret wrote: > > On Thursday 16 Jan 2020 at 16:15:02 (+0100), Peter Zijlstra wrote: > > > > @@ -10275,6 +10281,7 @@ static void task_tick_fair(struct rq *rq, struct task_struct *curr, int queued) > > > > { > > > > struct cfs_rq *cfs_rq; > > > > struct sched_entity *se = &curr->se; > > > > + unsigned long thermal_pressure = arch_cpu_thermal_pressure(cpu_of(rq)); > > > > > > > > for_each_sched_entity(se) { > > > > cfs_rq = cfs_rq_of(se); > > > > @@ -10286,6 +10293,7 @@ static void task_tick_fair(struct rq *rq, struct task_struct *curr, int queued) > > > > > > > > update_misfit_status(curr, rq); > > > > update_overutilized_status(task_rq(curr)); > > > > + update_thermal_load_avg(rq_clock_task(rq), rq, thermal_pressure); > > > > } > > > > > > I'm thinking this is the wrong place; should this not be in > > > scheduler_tick(), right before calling sched_class::task_tick() ? Surely > > > any execution will affect thermals, not only fair class execution. > > > > Right, but right now only CFS takes action when we overheat. That is, > > only CFS uses capacity_of() which is where the thermal signal gets > > reflected. > > Sure, but we should still track the thermals unconditionally, even if > only CFS consumes it. I agree, tracking thermal pressure should happen even if no cfs task are running > > > We definitely could (and maybe should) make RT and DL react to thermal > > pressure as well when they're both capacity-aware. But perhaps that's > > for later ? Thoughts ? > > Yeah, that's later head-aches. Even determining what to do there, except > panic() is going to be 'interesting'.