Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp469274pxj; Thu, 10 Jun 2021 05:23:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJynLXNLizZpge9KP17Wj8JFy5oLcGOdG9U6bxq0GcotOEu3IBIT0MCmwZO1YKLs/fkV6iV6 X-Received: by 2002:a05:6402:2790:: with SMTP id b16mr4419403ede.115.1623327783450; Thu, 10 Jun 2021 05:23:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623327783; cv=none; d=google.com; s=arc-20160816; b=yhZjXkA2ld8/F7d7GuAOQ0QyhWh8XYVlAJ22J9VRYbVUPLbYPna7R9Y+sJojpttg6H m7xzezo0xIeQaKQazv359DgRLQxSU1kcTf8VMoFMk5DT7+PAqQtt2EJUzfw5dlTtPN6T 8SQowUndErj05wVRAFHBYSysyNGxDAQmfsDNtNOuQy2Sg63tbqU3CqAx2pQHp7Et0pTA jM83NdUa02+R43vpxJ86Znf4Mg7Pu9K3/snuGkobJ3gAVN97F1YJiR58oaxXpUxKbmxi Kjt7Y39nu49/+s9vG8FvQ5lRAUErpjK8nTuPq1qt5unYNZKfqGuheTXOKN0TrrBIDm7B i0BQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=B5saXN8y8jJnqzcobNPFjAY/LSyHRP80akt09QmswJ4=; b=IXrybKGlBUdkWau+fCzHF/W3UtMgNTpUMfsX9AssxuJnvaaQJulNQGpWfD4bEgZ9ja Q3u35kJs71BNSl41q42BsgXytKfv0Q5rZ7fmZ/ZCdtp/IvqrxY/YRLVbgkmmkboTI66p PJ9n4oqAXTdzC0bRM5K3gIipHHoMj6aI/UD2T+V1FzVyv/mr30tjZUYqAbTp8ZUKuDKL 0t1pPzI+mX1GDe9iUhjjsy21f4Jk8ZO8cWz1Z3ueymqDWbkWmHj5jJvxQxUYH1jtwh3V E2JRf5/CCDT7UAWXm7EvxtE262hwu8936xfrLi8cXP9TdrIwfuuEunMCA5RxczZllIzf XdQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="e/2hVyE4"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id gh25si2156123ejb.170.2021.06.10.05.22.40; Thu, 10 Jun 2021 05:23:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="e/2hVyE4"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S230248AbhFJMWy (ORCPT + 99 others); Thu, 10 Jun 2021 08:22:54 -0400 Received: from mail-lj1-f169.google.com ([209.85.208.169]:39535 "EHLO mail-lj1-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230130AbhFJMWy (ORCPT ); Thu, 10 Jun 2021 08:22:54 -0400 Received: by mail-lj1-f169.google.com with SMTP id c11so4590288ljd.6 for ; Thu, 10 Jun 2021 05:20:57 -0700 (PDT) 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=B5saXN8y8jJnqzcobNPFjAY/LSyHRP80akt09QmswJ4=; b=e/2hVyE4fRiykxrzhmxMG/q+qyIOL1MUvYrqhuSdWzN0nMeZlMi6Ajpaw+yaKeMCCS 1h+y8jHR3niT07qbiKeaxsBaO/Adscm/eTQ6wpQ5HTbpLbdhg8m+lqvjk1F6Pgzp8+QI lkF2vcJ0Xc90f3pr5jPsg4LpqetxOmykeLl/H2Nwq5+6h8ZxBpQxEVjyRlzJifg5YlyJ WBOaau+HOhP2WsGfdwpOC6qxAM/6Gok0rv55SGkDxEeYkUBSeE6kh+NVv+mLL/3SaF2e k7zUqJDpac9+h1UAGSBMOA7SXTBDS3PfAExcqauPcvHZ53nSu6E1DftRONJZPJGiPTH8 WOsw== 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=B5saXN8y8jJnqzcobNPFjAY/LSyHRP80akt09QmswJ4=; b=BU3IjN84rAyxuo1FE9c1nn9WvyHEXIvgpDwXsCuUfH7ENa8GwtYcegHA5qGVKgXnU3 6l8Feh1Zn7hETL7BB0tUdOczStd+qJAKOpbcebizTu8B/xfSKZtsfFxDkPKFyux2AHan 1WM0a6fltJ9PHXzge6vioTl/Khk2T67rAnePfxaPlfxSxIiFIZtxrQ9S4gQDWMmMhK5Y rV1WZz1af7ULkN105PVDEU5xLj1hMbwHaxsALm/XctpWIsGkFEdikb/S1sOG0Y7St66I Z4oxwNlhrOzMkMVjdIb8LAITDAMv/Vdw0EnS7lCism/SeUqsjmfl0L3LIdxgdmD5UpX5 2bSw== X-Gm-Message-State: AOAM533gFYDoyr7zMA99tab/5kukK4JJVmUSLYB8cMsWPO1U9AYxMg3X +/yhG8R/zu5J4Ds6Qrz+91UceZmBPWdmdRt+JD1Gjw== X-Received: by 2002:a2e:9b07:: with SMTP id u7mr1941210lji.209.1623327597098; Thu, 10 Jun 2021 05:19:57 -0700 (PDT) MIME-Version: 1.0 References: <20210604080954.13915-1-lukasz.luba@arm.com> <20210604080954.13915-2-lukasz.luba@arm.com> <2f2fc758-92c6-5023-4fcb-f9558bf3369e@arm.com> <905f1d29-50f9-32be-4199-fc17eab79d04@arm.com> <3cfa5690-644b-ba80-3fc3-7c5a3f292e70@arm.com> In-Reply-To: From: Vincent Guittot Date: Thu, 10 Jun 2021 14:19:44 +0200 Message-ID: Subject: Re: [PATCH v2 1/2] sched/fair: Take thermal pressure into account while estimating energy To: Lukasz Luba Cc: Dietmar Eggemann , linux-kernel , "open list:THERMAL" , Peter Zijlstra , "Rafael J. Wysocki" , Viresh Kumar , Quentin Perret , Vincent Donnefort , Beata Michalska , Ingo Molnar , Juri Lelli , Steven Rostedt , segall@google.com, Mel Gorman , Daniel Bristot de Oliveira Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 10 Jun 2021 at 12:37, Lukasz Luba wrote: > > > > On 6/10/21 11:07 AM, Dietmar Eggemann wrote: > > On 10/06/2021 11:04, Lukasz Luba wrote: > >> > > [snip] > > >> Not always, it depends on thermal governor decision, workload and > >> 'power actors' (in IPA naming convention). Then it depends when and how > >> hard you clamp the CPUs. They (CPUs) don't have to be always > >> overutilized, they might be even 50-70% utilized but the GPU reduced > >> power budget by 2 Watts, so CPUs left with only 1W. Which is still OK > >> for the CPUs, since they are only 'feeding' the GPU with new 'jobs'. > > > > All this pretty much confines the usefulness of you proposed change. A > > precise description of it with the patches is necessary to allow people > > to start from there while exploring your patches. > > OK, I see your point. > > [snip] > > >> True, I hope this description above would help to understand the > >> scenario. > > > > This description belongs in the patch header. The scenario in which your > > functionality would improve things has to be clear. > > I'm sure that not everybody looking at this patches is immediately aware > > on how IPA setups work and which specific setup you have in mind here. > > Agree. I will add this description into the patch header for v3. > > [snip] > > >> > >> Yes, this code implementation tries to address those issues. > > > > The point I was making here is: why using the PELT signal > > thermal_load_avg() and not per_cpu(thermal_pressure, cpu) directly, > > given the fact that the latter perfectly represents the frequency clamping? > > > > Good question. I wanted to be aligned with other parts in the fair.c > like cpu_capacity() and all it's users. The CPU capacity is reduced by > RT, DL, IRQ and thermal load avg, not the 'raw' value from the > per-cpu variable. > > TBH I cannot recall what was the argument back then > when thermal pressure geometric series was introduced. > Maybe to have a better control how fast it raises and decays > so other mechanisms in the scheduler will see the change in thermal > as not so sharp... (?) > > > Vincent do you remember the motivation to have geometric series > in thermal pressure and not use just the 'raw' value from per-cpu? In order to have thermal pressure synced with other metrics used by the scheduler like util/rt/dl_avg. As an example, when thermal pressure will decrease because thermal capping is removed, the utilization will increase at the same pace as thermal will decrease and it will not create some fake spare cycle. util_avg is the average expected utilization of the cpu, thermal pressure reflects the average stolen capacity for the same averaging time scale but this can be the result of a toggle between several OPP Using current capping is quite volatile to make a decision as it might have changed by the time you apply your decision.