Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2597536imm; Mon, 10 Sep 2018 03:45:18 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZqqtHiehQvppp1z6J/Br/iGK6iaRV01/wluVgjfkdnHj4hmVPk5HY+lW8astE6av7OTArO X-Received: by 2002:a62:8559:: with SMTP id u86-v6mr23097846pfd.32.1536576318644; Mon, 10 Sep 2018 03:45:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536576318; cv=none; d=google.com; s=arc-20160816; b=rnh7Mgv+N6RMhK/GV32/5sLB6TCksbBa+0sZG8slRGVTJjaD2F0N9Lmbc2ustVoxWj Y9vfJwvTzyCcRXwP1kq8YsWobz/Dg3jJXmG7skajw6DrB5WXD4XnmrPOjjIOU+Qr7ubR T487U1/x4pbz1fxHiPM9qc1BF6G/7sdxY9iMbYKwOiia45X57BPX0dHsKCwbPSdK1fu3 OB0jEjNtCfTm744SiAG/2Ju7NW5+HFSEeGzPQMd41HLo+GTbPVggp1XB1uD2rrhS38OO lsy1JwsX+4CDyhXHyGGBzoq1PaHdErlkAfaj36OyHWgw+yf3bCb3WbSJ23pzi0QC1yUu 08Bw== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=iRFLjKCOLemd/Coc7+qD8nm/dE+evX98wPoZ3zvAaj4=; b=t0KjJ3e07ovWG5rpMhfJ6t1a3i9vBcQ0uuZ113bOnHpomE2acsv5kGlV5kJ3aQmdeE 3ptay6mrzAo1+Y2nMscKaG3u5T9ayo/gX4I6TGn/kRi3C02y0ab+xYveKf8x61bJTjs3 q+kEgz5zp3Sy/pMiySQKQhdvD9bykLiB6kwfPgi/INnThbUlCTmPOxGC6kSu+mPfVTAi 29tMtoDYYbYFIzIk6zAR9uNPKHTkcTRT3iq6F5t9V6K3x/EpgAPBM2YLWFnHH30Cxv9h 3ZLxP+kBQtSrcCUnsLu55Gp+wLvmY85T8nOPE0YbZwZLTT7t7YF0Ri7I8xhl2O+aoaJ9 eCfA== 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 a31-v6si16260633pgm.114.2018.09.10.03.45.03; Mon, 10 Sep 2018 03:45:18 -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 S1728051AbeIJPhB (ORCPT + 99 others); Mon, 10 Sep 2018 11:37:01 -0400 Received: from cloudserver094114.home.pl ([79.96.170.134]:45364 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727411AbeIJPhA (ORCPT ); Mon, 10 Sep 2018 11:37:00 -0400 Received: from 79.184.255.178.ipv4.supernova.orange.pl (79.184.255.178) (HELO aspire.rjw.lan) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer 0.83.123) id 121937182bd1877e; Mon, 10 Sep 2018 12:43:31 +0200 From: "Rafael J. Wysocki" To: Quentin Perret Cc: peterz@infradead.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, gregkh@linuxfoundation.org, mingo@redhat.com, dietmar.eggemann@arm.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, joel@joelfernandes.org, smuckle@google.com, adharmap@codeaurora.org, skannan@codeaurora.org, pkondeti@codeaurora.org, juri.lelli@redhat.com, edubezval@gmail.com, srinivas.pandruvada@linux.intel.com, currojerez@riseup.net, javi.merino@kernel.org Subject: Re: [PATCH v6 03/14] PM: Introduce an Energy Model management framework Date: Mon, 10 Sep 2018 12:40:55 +0200 Message-ID: <2400837.WDdV4EAXz7@aspire.rjw.lan> In-Reply-To: <20180910103802.l4zhewxgskchflsa@queper01-lin> References: <20180820094420.26590-1-quentin.perret@arm.com> <1866195.ZKEIBQluJJ@aspire.rjw.lan> <20180910103802.l4zhewxgskchflsa@queper01-lin> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Monday, September 10, 2018 12:38:05 PM CEST Quentin Perret wrote: > On Monday 10 Sep 2018 at 11:44:33 (+0200), Rafael J. Wysocki wrote: > > A kerneldoc comment would be useful here IMO. > > OK > > > > +struct em_cap_state { > > > + unsigned long frequency; /* Kilo-hertz */ > > > > I wonder if the "frequency" field here could be changed into something a bit > > more abstract like "level" or similar? > > > > The reason why is because in some cases we may end up with somewhat artificial > > values of "frequency" like when the intel_pstate driver is in use (it uses > > abstract "p-state" values internally and only produces "frequency" numbers for > > the cpufreq core and the way they are derived from the "p-states" is not always > > entirely clean). > > > > The "level" could just be frequency on systems where cpufreq drivers operate on > > frequencies directly or something else on the other systems. > > I see your point (and TBH we start to have same sort of problems on > Arm) but at this stage I would rather keep this field coherent with > what CPUFreq manages, that is, KHz. The only reason for that is because > the thermal subsystem (IPA) will look at this table to apply a max freq > capping on CPUFreq policies, so things need to be aligned. > > I agree that even if the unit of this field wasn't specified we could > still build a system that works just fine. However if things are too > loosely specified, problems are allowed to happen, so they will. Fair enough. > Now, if the CPUFreq core is modified to manipulate abstract performance > levels one day, I'll be happy to change the EM framework the same way :-) I don't think this is going to happen any time soon, though.