Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1554303ybl; Thu, 30 Jan 2020 01:50:44 -0800 (PST) X-Google-Smtp-Source: APXvYqzGKXNSg0uW5RJonZ/X+QnnICNXhxY//tmEXqWwgoDkyTojCFfVipia9LsqzuN8TTvEs1sf X-Received: by 2002:a05:6830:2110:: with SMTP id i16mr2794958otc.337.1580377844374; Thu, 30 Jan 2020 01:50:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580377844; cv=none; d=google.com; s=arc-20160816; b=C5zpGtA7LFOJshgK3XTalU5fKOnJ97017AYSVEV8ehL9t622hQvKGrx+ge3UzuAATS qXRqqerPP69zK3h8G7OPDb3yWerdjA9KEujXJf1grZbTWeK+Jwh9bjJ+d6Her5gV+EK8 6LaVBdtZWAtHcM19dfAeppt4YDbg9fFVUcd+/iXJt8yjy177gzzGyTBSFfIwX4UCT+AG jP2mB3NPpdMndoOqsb64Pb+tGY89JT9khe9kFUB5ko1TzdCej8onQZSOGs1ImWk+LQ61 xoKRVXgTexvpUVT+IusKyovqINRRMCJd/8HBh0CL3Ra4ejFOgoac5/wcFSdhAYtfUBUe PWGQ== 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=Y7mpfXEEdg2j7N0KRo5LM+dEv4sTPhHftYE87IZmXl8=; b=ziNuOyc2/4VGmrtNikgLorFOsC1scxeV1xW4lT+rb8V0QeFgfPIG78y5NvBO0SxA4U q9uZnuScLxo5fA9FhwA0sIaYEKUBFiMBRHYj+6A8astumkcf/SscNtKBAyi0trIXHX8s RNvVN0ffq1XPOxPKGLHRKIX+rG8JDCpWNqeuwqQCc8mMo3Dag1z731hixV91577O8iP3 Jt17azNIhIhZys4ff/Ax4IhWYsMQT3Kmw+FzeNqA89hQWa1APduyzJ6yejd/voa7I+GV f5AooVJSyIjt6YNRIyVTqnKNJ/0mqdk6j2K0wrXTK6G1H/gKE2MGh1yKu/bMaACOnaYn o5GQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LOmAUKow; 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 d1si2642611oth.158.2020.01.30.01.50.31; Thu, 30 Jan 2020 01:50:44 -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=LOmAUKow; 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 S1726922AbgA3Jti (ORCPT + 99 others); Thu, 30 Jan 2020 04:49:38 -0500 Received: from mail-lj1-f196.google.com ([209.85.208.196]:33528 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726873AbgA3Jti (ORCPT ); Thu, 30 Jan 2020 04:49:38 -0500 Received: by mail-lj1-f196.google.com with SMTP id y6so2638744lji.0 for ; Thu, 30 Jan 2020 01:49:34 -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=Y7mpfXEEdg2j7N0KRo5LM+dEv4sTPhHftYE87IZmXl8=; b=LOmAUKowzWnUWfKeU27Au6YRUWwO5v/qVKOjPJlPJOUz3KyDZPGXz2+y/Nzq6iiZab uynHO8N2/kJnryUWaSma1UxqZ2GOaOx4UFjmhdyQCXfRcYKTMkSgNnskgHmSow494KNX J3xKpRLmEEzuavhtpwEX0tp8+Ze9lk+5IvrAgxCn7SKaFbvyF16MAbnSs65mJWxWXwXd nFgWUyIMC3vVN2te3PTnNu7S0ozEe99OpPSOi3zf8t+WD/p3MCrwnHfhiE2gIuDLyvut NQEvOlUi8zQGZLwNvflc7lo5CZb1Xph84EM+O2WeARfU6ZYn0YIpoK0plhsWaQfevtKS X2Dw== 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=Y7mpfXEEdg2j7N0KRo5LM+dEv4sTPhHftYE87IZmXl8=; b=ZNWCuRLakRkqZ4LaBft03gkPEXZVyaVX92onl/TwwE2mDgETwWzS6vJSbVw19ad+am EhZqWddk4mX9xnT+e+NRLRfFFDg0za/nZOOD9d5Q2TLiQEg4TW/6S5B6HyJfsoiVEahF gWDIKTcmeJUTRJERT+DSWG5IQdP5v6RBXtBkqEmhIamwhW4cvCPZIurxhqEAMpzNZWeJ 9S5tKIrQx9lBFJItqXqEG+SMsZ5UFFnbNGNOZ8O8W1AIbo8IEl4h7BvOwh2VtG/aR5C5 oWfo+rUE9kqi9gC2WGqr9fQ8RMXyvsqLvbhZ1VpTP85SzvDF/rkYaxyUIR9u93QtUVev FrSg== X-Gm-Message-State: APjAAAUIH8G7Kirjfex67yVoPs9OGQxVFMc9obwU1cJ8OBDMwwtQ5akw 6rYUB8+GgaJAAo+P35z6uZG7bIwPsKikIDmXPtgb5R+4oLdTyQ== X-Received: by 2002:a2e:909a:: with SMTP id l26mr2101837ljg.209.1580377772183; Thu, 30 Jan 2020 01:49:32 -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: Thu, 30 Jan 2020 10:49:20 +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 Wed, 29 Jan 2020 at 16:41, Dietmar Eggemann wrote: > > On 27/01/2020 16:15, Vincent Guittot wrote: > > 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 > > There is already a v9 but I comment here so the thread stays intact. > > I guess this thread leads to nowhere. For me the question is do we > review against existing code or some possible future changes? The > arguments didn't convince me so far. > But we're not talking functional issues here so I won't continue to push > for change on this one here. > > >> [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. > > -... > > > > " > > I went back to the v6 review. Peter originally asked for a better name > (or an additional comment) for arch_scale_thermal_capacity() because the > return value is not capacity. > > So IMHO arch_scale_thermal_pressure() is a good name for keeping this > aligned w/ the other arch_scale_* functions and to address this review > comment. > > arch_scale_cpu_capacity() - scale capacity by cpu > arch_scale_freq_capacity() - scale capacity by frequency > arch_scale_thermal_pressure() - scale pressure (1 - capacity) by thermal If arch_scale_thermal_pressure() is ok for everybody i'm fine too. I don't have a strong opinion about the name of the function as long as we don't go back and forth > > [...]