Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp305342ybx; Wed, 6 Nov 2019 00:33:35 -0800 (PST) X-Google-Smtp-Source: APXvYqxJrB/pY+F/8GTLk4SJjcKZ0ugSnYblCEE6RCW0qEmQcrGX7gjYtZZ8Ep/ZuXL6MsFcUh9Q X-Received: by 2002:a17:906:3d2:: with SMTP id c18mr25482750eja.111.1573029214914; Wed, 06 Nov 2019 00:33:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573029214; cv=none; d=google.com; s=arc-20160816; b=cb3LdQkv/eDrb8NfU5Wcg21OOKfTbCdqPN5Uz/FbaurjuP0LaqfAlVjz6gal9g7+Oz cVVBJI67Df6YgAc2HRjjNW+mDQGBu1Mu3boh1kORMym3kp402L22Xep0eGqALuW0GUZt n0T9UCc0zxAF0/wsUj9r6Q8mCJRAAh7cZgSvy5+OxCegvkf5G5g04c+vjuqYiHABH3ox 1zaIgGJOvbiT3v9uGbZdrP9ovsi/SEWA1cv/v+3aBZ7r5qp5Qf9diuebw8HYuscy6prO 0oOoFlfSYWvjF4N5UXb4CaL0tEIwQeuFKYnFAItgBkyoSnTjr5aOPNJfCnpGDlyKjjzF 70uw== 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=UfU4NeD6tWwvbn+OCuUBpeKGLeW4/SjBIuSOjEeExYc=; b=ZHjPGpTQfSSzt7l500pf/wZZ2YJuQNLKUBwuL6nlYYChKUXD8VsWCaXCLac/DlHjP/ emfB97oGpTi4nRMMg0B42wttWRZejhZMo06lsSRa06TQ8sFqRzj2Ca0t1AnDSVCzVMEl y5dugGuZAu/6V5n6sHwB9s+Dh6qmFPCNPRp3kp6q8srkn5V3+WUiemjmaA70msW85B6D YKrgSMtIDEmxmiWUt6nlEgaPxPmii/vP7rL8DeFkSkWdaYPm8dgTQeUi6kPnHqeruXW1 NzrKsTGis16+1nXCV0UWl0zNEm+5KjBD0MyWVFO6zs7Y8SGWZ3XAt8YYcfc/rZwrdC2/ NuUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="uNP1KXd/"; 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 i24si14888674ejh.35.2019.11.06.00.33.11; Wed, 06 Nov 2019 00:33:34 -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="uNP1KXd/"; 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 S1731045AbfKFIc3 (ORCPT + 99 others); Wed, 6 Nov 2019 03:32:29 -0500 Received: from mail-lj1-f195.google.com ([209.85.208.195]:41973 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729951AbfKFIc3 (ORCPT ); Wed, 6 Nov 2019 03:32:29 -0500 Received: by mail-lj1-f195.google.com with SMTP id m9so25023824ljh.8 for ; Wed, 06 Nov 2019 00:32:28 -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=UfU4NeD6tWwvbn+OCuUBpeKGLeW4/SjBIuSOjEeExYc=; b=uNP1KXd/gAPRLd0Eazn3Zf4B0u8fajPWtMoC9BhRbuQx6jrzvJIGhOKHc48SewNhIg +p0aF/NYvyVmb9Z2R71vkEHF+YP0R5eZ0oKTyc1Bx7MGXTDlPXmwXkxAVfv6hyVibwXE vNwWUTMz2t1bgLmyV/Iu7TrlvZx7KiiyUBdkDw0OLrjxmeBEUJkNmTCw4xdEZ/19a4Gp 8BiZlp/7mn4WkmyiVuD0czhy6lzDAWn4qXJEjXvSwfFb5k1x+r04X1H7OWziYK3NzUxh +4XXa41XBfE4RfdqcRhV+r6tugdU/FQh9l6Gr8VqABhaCV2HpqHS9E4YuaI9kPs8b0Ma crTQ== 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=UfU4NeD6tWwvbn+OCuUBpeKGLeW4/SjBIuSOjEeExYc=; b=fVnxC6yFcf+g989+jgQlQY4pLuGBevwrVxKn90t1souZiS4WiYIbL7nutmJb7zW58f yUafhvLj8r2iOb4zLcgmcvdIGG++0yt0rSMdBYDJmcwWkl4rGPA/cCVmKchTgxqJ7w2N IqR5ZCo8GXFqesQs2RXS+g4VUINLmGk9LVEiddBbqzOYPk/6Jgnj/4KTL1taXyjoBOo0 7lTPL+qrDAOG5T1hOT8XBkV4Gf6tLb6cIMey+QE86SeP4v9PAMchzct2lRKGHQ7wNTS9 zK7OVBcntUXt9TG1EDf1oVEDAHmCJPTdURtL3WsLhcS+IGWFgCDadkkns6Xk7MzT/abQ ErOA== X-Gm-Message-State: APjAAAX1Rv7pTNbIWH2SzvCytlZBOSrFQD3daG5JBEz5LYBXy5TrPKC9 cS6ZRVr2UfBZm1IWJ1wODEsIYk31Hapxq3ddZ4eBIg== X-Received: by 2002:a2e:b053:: with SMTP id d19mr1001036ljl.36.1573029147514; Wed, 06 Nov 2019 00:32:27 -0800 (PST) MIME-Version: 1.0 References: <1572979786-20361-1-git-send-email-thara.gopinath@linaro.org> <1572979786-20361-4-git-send-email-thara.gopinath@linaro.org> In-Reply-To: <1572979786-20361-4-git-send-email-thara.gopinath@linaro.org> From: Vincent Guittot Date: Wed, 6 Nov 2019 09:32:16 +0100 Message-ID: Subject: Re: [Patch v5 3/6] sched/fair: Enable periodic update of average thermal pressure To: Thara Gopinath Cc: Ingo Molnar , Peter Zijlstra , Ionela Voinescu , Zhang Rui , Eduardo Valentin , Quentin Perret , linux-kernel , Amit Kachhap , Javi Merino , Daniel Lezcano 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 Tue, 5 Nov 2019 at 19:49, Thara Gopinath wrote: > > Introduce support in CFS periodic tick and other 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 > --- > > v4->v5: > - Updated both versions of update_blocked_averages to trigger the > process of computing average thermal pressure. > - Updated others_have_blocked to considerd avg_thermal.load_avg. > > kernel/sched/fair.c | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > index 2e907cc..9fb0494 100644 > --- a/kernel/sched/fair.c > +++ b/kernel/sched/fair.c > @@ -92,6 +92,8 @@ const_debug unsigned int sysctl_sched_migration_cost = 500000UL; > */ > static DEFINE_PER_CPU(unsigned long, thermal_pressure); > > +static void trigger_thermal_pressure_average(struct rq *rq); > + > #ifdef CONFIG_SMP > /* > * For asym packing, by default the lower numbered CPU has higher priority. > @@ -7493,6 +7495,9 @@ static inline bool others_have_blocked(struct rq *rq) > if (READ_ONCE(rq->avg_dl.util_avg)) > return true; > > + if (READ_ONCE(rq->avg_thermal.load_avg)) > + return true; > + > #ifdef CONFIG_HAVE_SCHED_AVG_IRQ > if (READ_ONCE(rq->avg_irq.util_avg)) > return true; > @@ -7580,6 +7585,8 @@ static void update_blocked_averages(int cpu) > done = false; > > update_blocked_load_status(rq, !done); > + > + trigger_thermal_pressure_average(rq); This must be called before others_have_blocked() to take into account the latest update > rq_unlock_irqrestore(rq, &rf); > } > > @@ -7646,6 +7653,7 @@ static inline void update_blocked_averages(int cpu) > update_dl_rq_load_avg(rq_clock_pelt(rq), rq, curr_class == &dl_sched_class); > update_irq_load_avg(rq, 0); > update_blocked_load_status(rq, cfs_rq_has_blocked(cfs_rq) || others_have_blocked(rq)); > + trigger_thermal_pressure_average(rq); idem > rq_unlock_irqrestore(rq, &rf); > } > > @@ -9939,6 +9947,8 @@ 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)); > + remove blank line > + trigger_thermal_pressure_average(rq); > } > > /* > -- > 2.1.4 >