Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3851821pxb; Mon, 1 Feb 2021 06:24:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJyKrtU/J3jrhELo0QktYjj/wpuHUWGP7y0RDTsqwkyI8PJ2D0cFc1pdufldqA1YIHFqOul0 X-Received: by 2002:a17:906:5e5a:: with SMTP id b26mr6679233eju.327.1612189451063; Mon, 01 Feb 2021 06:24:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612189451; cv=none; d=google.com; s=arc-20160816; b=xwlrwKUscU4pLzfp+4WevKv6w3mLSDRdS2IEoiOendcrYjJ0iR8OZdO1wIsgX+Fa/f U/uSpVucjDiRXZTMVk+wT/6CbM6TI+lTRBKX0FTELpVEZvqi+htFczKf4xlrKn3DwSLd SfzRh2KU6yJ8fvCrMgcHliWPZsK13IJ7lGf1RQLbOtB004QGwi1vkCjrdxDB7+rpVC8z QfB6UwgXVZhn89XqqbWDpfLEw+yFyfUfbNnNH+F8eiWk3KlSsq/eyxQFV3LXrJbRO9NC FVYcRO6vU52Y2918eGQUWgugjP1RyZb4JUn/KkFn8ZuheHi4XJm9sPg2vODRyeP9rTwk 9fQg== 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; bh=Nl0r7E4pmPDbzLNU5N8bDECPX3AdG/sX/U/vlhC1xFk=; b=nA2nMXnRY1uScPjRPN//c+8+0dKMJdUe0c4Gfv/MGxR+hdWvDSoy8jtnlpJNX0NxWR TV6GmrOoKTnBy3dxmOq85jlqtnFpyvPy+w4soC5KNetivX1mJ3tKqOjpQ6fXe3pDJltG WX+LYWfJ2EFp3CLqYavSoW0nkyA5iidnmqrxbCVOVfzfcSLTAgBaFj9BscyF15MgVRDC nQNFBT32o/IO9xiHli+axCg/zTK+r/WmjHiuJa/J42QHTWDTK9FZsegKshHQL9s8mvM7 KwkQXThRbabhz8zK0nhfWrbophBvgM9Pv8mYKdLiT0DRpTZe0jGFPedWOqRxPat2n68l Rjvg== ARC-Authentication-Results: i=1; mx.google.com; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d12si11034534ejb.358.2021.02.01.06.23.46; Mon, 01 Feb 2021 06:24:11 -0800 (PST) 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; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232480AbhBAOT4 (ORCPT + 99 others); Mon, 1 Feb 2021 09:19:56 -0500 Received: from mail-oi1-f181.google.com ([209.85.167.181]:45632 "EHLO mail-oi1-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231657AbhBAOTy (ORCPT ); Mon, 1 Feb 2021 09:19:54 -0500 Received: by mail-oi1-f181.google.com with SMTP id g69so18883433oib.12; Mon, 01 Feb 2021 06:19:38 -0800 (PST) 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=Nl0r7E4pmPDbzLNU5N8bDECPX3AdG/sX/U/vlhC1xFk=; b=hf4+ue6GgKRubzn8XHs5QlRnkkMCnu+kJ8KpOJ2+bmOoElvND+Wq5/IDzCWm1d42fl /jFXMHlLDVyrgMgivYH5ni9JsWuu+GkbaLhi4p6qjrjlqIOs42SQu3k2n8lnPJOi+dpU e0FAmP1XsUVRA2PsrDeREKRdb6jHL17Jtjr9l0jUv0ZQD9hzCnmSwz7puZYA7wHYq1nf IlK6+VJl7nmzcrlOxxXKD9/fE3jF78E6BpwHhawj4zkPADSD/Jhhy7nF268SbX/kGo/T wfzMPC/x8XJEJJHfVdk6pt/ugEjHFMvx/1e9y/A+ymjxANf3BS13ulXisIanrkli4Xmg hPew== X-Gm-Message-State: AOAM532IROtiOam3dv6BMp7n9fH7ru/PtT5HBd1VdQYjD9edQLzJsyNp OHUgcvKy6uULpvxMV4pmFgkJkwSTSlMU/PHRsaY= X-Received: by 2002:aca:308a:: with SMTP id w132mr10398744oiw.69.1612189153445; Mon, 01 Feb 2021 06:19:13 -0800 (PST) MIME-Version: 1.0 References: <20210126104001.20361-1-lukasz.luba@arm.com> In-Reply-To: <20210126104001.20361-1-lukasz.luba@arm.com> From: "Rafael J. Wysocki" Date: Mon, 1 Feb 2021 15:19:02 +0100 Message-ID: Subject: Re: [RFC][PATCH 0/3] New thermal interface allowing IPA to get max power To: Lukasz Luba Cc: Linux Kernel Mailing List , Linux PM , Viresh Kumar , "Rafael J. Wysocki" , Daniel Lezcano , Dietmar Eggemann , Amit Kucheria , "Zhang, Rui" , Chanwoo Choi , Myungjoo Ham , Kyungmin Park Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 26, 2021 at 11:40 AM Lukasz Luba wrote: > > Hi all, > > This patch set tries to add the missing feature in the Intelligent Power > Allocation (IPA) governor which is: frequency limit set by user space. > User can set max allowed frequency for a given device which has impact on > max allowed power. If there is more than one frequency that can be limited for the given device, are you going to add a limit knob for each of them? > In current design there is no mechanism to figure this > out. IPA must know the maximum allowed power for every device. It is then > used for proper power split and divvy-up. When the user limit for max > frequency is not know, IPA assumes it is the highest possible frequency. > It causes wrong power split across the devices. Do I think correctly that this depends on the Energy Model? > This new mechanism provides the max allowed frequency to the thermal > framework and then max allowed power to the IPA. > The implementation is done in this way because currently there is no way > to retrieve the limits from the PM QoS, without uncapping the local > thermal limit and reading the next value. The above is unclear. What PM QoS limit are you referring to in the first place? > It would be a heavy way of > doing these things, since it should be done every polling time (e.g. 50ms). > Also, the value stored in PM QoS can be different than the real OPP 'rate' > so still would need conversion into proper OPP for comparison with EM. > Furthermore, uncapping the device in thermal just to check the user freq > limit is not the safest way. > Thus, this simple implementation moves the calculation of the proper > frequency to the sysfs write code, since it's called less often. The value > is then used as-is in the thermal framework without any hassle. > > As it's a RFC, it still misses the cpufreq sysfs implementation, What exactly do you mean by this? > but would be addressed if all agree. Depending on the answers above. But my general comment would be that it might turn out to be unrealistic to expect user space to know what frequency limit to use to get the desired result in terms of constraining power.