Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2336520imm; Thu, 7 Jun 2018 09:00:33 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLmiDRSGYDv1/5PSoqtlgSX4OWoRxleshRjFTVwcJCQDOkMW/z3WOJ24DiKCFNVkRWY4gZr X-Received: by 2002:a63:bf49:: with SMTP id i9-v6mr2087764pgo.342.1528387233010; Thu, 07 Jun 2018 09:00:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528387232; cv=none; d=google.com; s=arc-20160816; b=em81Cy1BfvUnOT2OBWYb2cJZxsIo7uC/HjAYwvOSegerGLKPrBMeQ7B18YCTbrK1vj zkDFF/6hjJVeV4OtlIIpOp1xRA7QlAhnDrS/esp8mFnAPYltq4FQ5ICMGdSOqF0v9lgL g1fqaOsXpkMDsyANi5EqRtc3ebB3xcqmB3XzstoPTi1hAW95AILiCRqdKYx5K3wn/ZXa cl/RRpa5CRvDACBrt8gMDSkXxH6+Ksb9+Kme3hl1Nb4H33y06dRk6+wjzW6tE05c4/rq EmDl76bF3ZIEPNd362FgP7le6z16Uhf2ufB/xfKLthLLbKbcFsfnRqFu+ESN8GcJvmDE sDVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=iouU7JHF60h1Nt32FUio1V8ePOOfw514pYYMW5U6ylE=; b=J2yiOn3lNRHx9zbSO3qMdZ+t7vSkvXuXPdECtjW7gj1Y3FLjUV2r6h+Lfhj3tISdKW /Ux/ZRdQ+8IdCeo+QRFqEcMhh5qCjl9bInhhiFx9LNKvksa6qIObYRkBh4cSa+m2ZxLk 6t9kTphqW3JzJ741Z+M3XqGB2jlyRzr1Xj2nn8E1k95kAN+vE50gnnbkXC0R9zG0DCFW YzOcHioUlmKbqmJMdJGhZAfXnp1GPkvbDOaeUn6ZID6vConmwC7heR0pG+YXMNxUR9Ss saaQ4ZXirlMxaRmUavdtxr21ivcoVDQxyn7AfbkEDBR8aOtY7t+50JPq/g4ekcUFUoDd u8vw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s11-v6si4911092plp.464.2018.06.07.09.00.18; Thu, 07 Jun 2018 09:00:32 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934730AbeFGP6U (ORCPT + 99 others); Thu, 7 Jun 2018 11:58:20 -0400 Received: from foss.arm.com ([217.140.101.70]:53874 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933050AbeFGP6P (ORCPT ); Thu, 7 Jun 2018 11:58:15 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 8CE3D80D; Thu, 7 Jun 2018 08:58:15 -0700 (PDT) Received: from [192.168.0.102] (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id F03B53F59D; Thu, 7 Jun 2018 08:58:10 -0700 (PDT) Subject: Re: [RFC PATCH v3 03/10] PM: Introduce an Energy Model management framework To: Quentin Perret , Juri Lelli Cc: peterz@infradead.org, rjw@rjwysocki.net, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, mingo@redhat.com, morten.rasmussen@arm.com, chris.redpath@arm.com, patrick.bellasi@arm.com, valentin.schneider@arm.com, vincent.guittot@linaro.org, thara.gopinath@linaro.org, viresh.kumar@linaro.org, tkjos@google.com, joelaf@google.com, smuckle@google.com, adharmap@quicinc.com, skannan@quicinc.com, pkondeti@codeaurora.org, edubezval@gmail.com, srinivas.pandruvada@linux.intel.com, currojerez@riseup.net, javi.merino@kernel.org References: <20180521142505.6522-1-quentin.perret@arm.com> <20180521142505.6522-4-quentin.perret@arm.com> <20180606143739.GF10870@e108498-lin.cambridge.arm.com> <20180606152000.GB15894@localhost.localdomain> <20180606152950.GH10870@e108498-lin.cambridge.arm.com> <20180606162647.GI10870@e108498-lin.cambridge.arm.com> From: Dietmar Eggemann Message-ID: <2802df66-8947-dc2c-a99f-cf872ddaeddb@arm.com> Date: Thu, 7 Jun 2018 17:58:09 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180606162647.GI10870@e108498-lin.cambridge.arm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/06/2018 06:26 PM, Quentin Perret wrote: > On Wednesday 06 Jun 2018 at 16:29:50 (+0100), Quentin Perret wrote: >> On Wednesday 06 Jun 2018 at 17:20:00 (+0200), Juri Lelli wrote: >>>>> This brings me to another question. Let's say there are multiple users of >>>>> the Energy Model in the system. Shouldn't the units of frequency and power >>>>> not standardized, maybe Mhz and mW? >>>>> The task scheduler doesn't care since it is only interested in power diffs >>>>> but other user might do. >>>> >>>> So the good thing about specifying units is that we can probably assume >>>> ranges on the values. If the power is in mW, assuming that we're talking >>>> about a single CPU, it'll probably fit in 16 bits. 65W/core should be >>>> a reasonable upper-bound ? >>>> But there are also vendors who might not be happy with disclosing absolute >>>> values ... These are sometimes considered sensitive and only relative >>>> numbers are discussed publicly. Now, you can also argue that we already >>>> have units specified in IPA for ex, and that it doesn't really matter if >>>> a driver "lies" about the real value, as long as the ratios are correct. >>>> And I guess that anyone can do measurement on the hardware and get those >>>> values anyway. So specifying a unit (mW) for the power is probably a >>>> good idea. >>> >>> Mmm, I remember we fought quite a bit while getting capacity-dmpis-mhz >>> binding accepted, and one of the musts was that the values were going to >>> be normalized. So, normalized power values again maybe? >> >> Hmmm, that's a very good point ... There should be no problems on the >> scheduler side -- we're only interested in correct ratios. But I'm not >> sure on the thermal side ... I will double check that. > > So, IPA needs to compare the power of the CPUs with the power of other > things (e.g. GPUs). So we can't normalize the power of the CPUs without > normalizing in the same scale the power of the other devices. I see two > possibilities: > > 1) we don't normalize the CPU power values, we specify them in mW, and > we document (and maybe throw a warning if we see an issue at runtime) > the max range of values. The max expected power for a single core > could be 65K for ex (16bits). And based on that we can verify > overflow and precision issues in the algorithms, and we keep it easy > to compare the CPU power numbers with other devices. I would say we need 1). 32bit values with units and proper documentation of the possible ranges. [...]