Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3617010ybl; Mon, 27 Jan 2020 07:16:26 -0800 (PST) X-Google-Smtp-Source: APXvYqwBO1vN09Mm28Cq0Gkkoiy4ZQxLWDZ9C6G7HuOtijWvBD45jXEULQ2o1qm+QlNZXh4TBdDu X-Received: by 2002:a9d:3bc4:: with SMTP id k62mr13341187otc.186.1580138185800; Mon, 27 Jan 2020 07:16:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580138185; cv=none; d=google.com; s=arc-20160816; b=KDpxQBjyONuSEPxDkpXbfxWbUef+Hbb0qOHjP6jqPlpXs7w4vOziehQQstpq15qwgR EgphIlI1B7RTH/z/udvVHwJWlVhPU+T2f9BerMbXUXRfBsaGABFms9FaSbee5+TIo6OT RcNUSWrO/R2bccCmMEWrKq8pa6Q0OhY0cXuEgRN7hLrOEX6vDoYE0w0ZhEKOK9UyYumL eUh+IUkn19x0QygIUNC8JD3Vn00FCZqE4ZweHtv3DxlExpEpnKY1Dm2Gpb0Zo/Ukj6ja PjP8B4rXTFKgkQ54VD1p2z1dO0vBGmkvG/i1Cd3I7mCW2MHn54Bdx1taHHa9YeI94q68 K7fA== 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=m+OnEfzyfg+muaU/2AUGZRAG0jjXR+QcDzWNJ7FtrgE=; b=QVtUaFHaGsiEfeHQdcbtQbfiaIlVozlhOZiGvR3XberqSTRu90jtea+HRMbhogms/4 fchHwe04sobTEk69McqWnYGSdwVhguGxMkokFS9uomlQgq67SBoemPi02nXCHxgoIRum Pv/ervmjkuVKFbk1KSUpBe16virAWgTvrKJ0eDWD55e9nUyyT18Yk5/7KYMSQp6C+GN3 mv3EcvPiFz7yK/eR6HG+Dj/7i4IOajWiuUwvIKz+zG5Uj1oT9HKEdzp3w66CEYr3LLFp Hj0irWAhQCCzpnOv1lfd6AXeshfuiNf01ZCJYHFWKgFp/d5/gr16SjJU0BBvEDwHptWH j4+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=paCWn4fR; 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 f5si4731217otp.129.2020.01.27.07.16.12; Mon, 27 Jan 2020 07:16:25 -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=paCWn4fR; 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 S1729335AbgA0PPS (ORCPT + 99 others); Mon, 27 Jan 2020 10:15:18 -0500 Received: from mail-lj1-f195.google.com ([209.85.208.195]:45303 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729146AbgA0PPS (ORCPT ); Mon, 27 Jan 2020 10:15:18 -0500 Received: by mail-lj1-f195.google.com with SMTP id j26so11036452ljc.12 for ; Mon, 27 Jan 2020 07:15:17 -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=m+OnEfzyfg+muaU/2AUGZRAG0jjXR+QcDzWNJ7FtrgE=; b=paCWn4fRy110Dggp/mnjowZDRQwZUnLbDFR8w3jX3jDPvgCjktfRhj7wBkqtasZLkf t/J1rcWs8k2O1YvuMzvkMzH4wc8gGmJDq1MCI/liEXywdK7vd69moww8clsw+BRT+eRb IPlWUBhP82hoemb3DqHIjTrexQCBzar9PKu6i7L8uWuzSZ65AXq1xKNkyXNDgbU40GBZ oLOb+uYX1rAV3K0iv34WeJOlut/haIgrQoEK0JUlgYoTVwnioJfmHOi9aOkpL1VIE4HW zsd4z+V9dnANDam3cR/Q+bU1rCDaHtxGaar+FTrUy17jJKExiunjsERx9OM2udvNH61E bm+w== 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=m+OnEfzyfg+muaU/2AUGZRAG0jjXR+QcDzWNJ7FtrgE=; b=WAFsC9cychf058nSkbZNYm/1h548GF72kA8lnQJhJL12Ah2REunoZXvtqLIp73kgM7 LHQO9vPDE+Jz1z8dN8Ofc7KPedCGVVrc5iJbNN7WvJG3Rx1d6RJZzmFySSG1C6yWPrYH 1DmfPDaWkSA5MIKb/Z9lJnyMjvKIiTtKAk7gmcHQFb0LiCecD91XyU5p+7B2w9aNkzRb Xmr/4MggneKybTqxZzdHseoAG2OIRXko2cf8hkWFUGnhwLOm7dP4S/xnZJpniAMeE8AX q7L8vU1PkNKDexekz5je0nioHjKl4cN2/ofc0fZqc3dmOaD02NJU/N5SvR3pCTOt8l2M 6caw== X-Gm-Message-State: APjAAAVY0oN7gtY/f2jzjghb9xQPaBxvV3DmdUS0QDUllhWtSWRTeCg9 NuU0X3kE5qnE9MC/XMym+kOY9aREWetinSCz3YDQEA== X-Received: by 2002:a2e:909a:: with SMTP id l26mr9881296ljg.209.1580138116210; Mon, 27 Jan 2020 07:15:16 -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> <20200117145544.GE14879@hirez.programming.kicks-ass.net> In-Reply-To: From: Vincent Guittot Date: Mon, 27 Jan 2020 16:15:04 +0100 Message-ID: Subject: Re: [Patch v8 4/7] sched/fair: Enable periodic update of average thermal pressure To: Dietmar Eggemann Cc: Peter Zijlstra , Thara Gopinath , Ingo Molnar , Ionela Voinescu , Zhang Rui , Quentin Perret , Daniel Lezcano , viresh kumar , linux-kernel , Amit Kachhap , Javi Merino , Amit Kucheria 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 Mon, 27 Jan 2020 at 13:09, Dietmar Eggemann wrote: > > On 24/01/2020 16:45, Vincent Guittot wrote: > > On Fri, 24 Jan 2020 at 16:37, Dietmar Eggemann wrote: > >> > >> On 17/01/2020 16:39, Vincent Guittot wrote: > >>> On Fri, 17 Jan 2020 at 15:55, Peter Zijlstra wrote: > >>>> > >>>> On Fri, Jan 17, 2020 at 02:22:51PM +0100, Vincent Guittot wrote: > >>>>> On Thu, 16 Jan 2020 at 16:15, Peter Zijlstra wrote: > > [...] > > >> The 'now' argument is one thing but why not: > >> > >> -int update_thermal_load_avg(u64 now, struct rq *rq, u64 capacity) > >> +int update_thermal_load_avg(u64 now, struct rq *rq) > >> { > >> + u64 capacity = arch_cpu_thermal_pressure(cpu_of(rq)); > >> + > >> if (___update_load_sum(now, &rq->avg_thermal, > >> > >> This would make the call-sites __update_blocked_others() and > >> task_tick(_fair)() cleaner. > > > > I prefer to keep the capacity as argument. This is more aligned with > > others that provides the value of the signal to apply > > > >> > >> I guess the argument is not to pollute pelt.c. But it already contains > > > > you've got it. I don't want to pollute the pelt.c file with things not > > related to pelt but thermal as an example. > > > >> arch_scale_[freq|cpu]_capacity() for irq. > > But isn't arch_cpu_thermal_pressure() not exactly the same as > arch_scale_cpu_capacity() and arch_scale_freq_capacity()? > > All of them are defined by default within the scheduler code > [include/linux/sched/topology.h or kernel/sched/sched.h] and can be > overwritten by arch code with a fast implementation (e.g. returning a > per-cpu variable). > > So why is using arch_scale_freq_capacity() and arch_scale_cpu_capacity() > in update_irq_load_avg [kernel/sched/pelt.c] and update_rq_clock_pelt() As explained previously, update_irq_load_avg is an exception and not the example to follow. update_rt/dl_rq_load_avg are the example to follow and fixing update_irq_load_avg exception is on my todo list > [kernel/sched/pelt.h] OK but arch_cpu_thermal_pressure() in > update_thermal_load_avg() [kernel/sched/pelt.c] not? > > Shouldn't arch_cpu_thermal_pressure() not be called > arch_scale_thermal_capacity() to highlight the fact that those three Quoted from cover letter https://lkml.org/lkml/2020/1/14/1164: " v6->v7: - ... - Renamed arch_scale_thermal_capacity to arch_cpu_thermal_pressure as per review comments from Peter, Dietmar and Ionela. -... " > functions are doing the same thing, scaling capacity by something (cpu, > frequency or thermal)?