Received: by 10.213.65.68 with SMTP id h4csp2835667imn; Mon, 9 Apr 2018 09:46:29 -0700 (PDT) X-Google-Smtp-Source: AIpwx481e24lC8W8GNmv8YCibpV5jdjqeLplSLrBJPNMfEIKxLGT/ZvdhVEC/ltTSK4EBQxRcR0s X-Received: by 2002:a17:902:43:: with SMTP id 61-v6mr34485163pla.259.1523292389451; Mon, 09 Apr 2018 09:46:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523292389; cv=none; d=google.com; s=arc-20160816; b=p2nZ/EJSy3OTDSBerDCKRkxxTrrqcGN03JFUkVqYIeHfj7Qqr40p27cvezXCkTNCx4 eNds9MX5U2M2hCJwi2iag/pkNAIuXwIjEho/0/zZVezy1+5w7BbS8ZudD5MT2xWZsqd8 lc8wMwzAiB+RJLx27zrw2Y/3T4+neg1NHurNjcWGe5MwLWsupUIJ105IJgBawk+0d71d u0s9Y9k1tg8b1GU2ZyY2f+OD8pP3ku0uRDQAuQ/WC5VH36oRl/FtxLf/saLaUtOopcNw CfDzaUrH3fUTUMn5MZMDhZLO6O6nYCHZNbC5A0c6uVFz/YVPJH8uHXkTLeO6okPI7IZz JYlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=EpsrHaCfY4EYE1tFUn/RUohwAI1f6g+qd1jOex5Ou9I=; b=FiEKtr46uwJkboxyh5x4YJQPmI6wPspAgf+xUWKW/viOadgAWy+0UBaDmfDAlqJa7N O5DfjSVIeW7K1mKF/BGWFAl/oTJxFIfUBqiDaFAjoD2cPqATcm0KO+eUCxQvVut69WMP EtTrNuB0H4hOc+FOaC/Wz2SLPd7PF2/P3xyhX4p6HWbOgT2qL60502m59XGx9JPSZKnz hXLFZXn9Kc+qUpgUn2BrpJ0CidKs/4AAWfoFHibq/OdovFhieMGNjvbCekAOsQUz4P9h dNKeCWA90mv7j+0CvOZDjC9vG+eqrJtTYNvSKInpMUr4IsHNiI3o56qjm8oCWyRJRMDA 9Ixg== 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 x7si520938pfk.311.2018.04.09.09.45.52; Mon, 09 Apr 2018 09:46:29 -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 S1753499AbeDIQmS (ORCPT + 99 others); Mon, 9 Apr 2018 12:42:18 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:58338 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753370AbeDIQmN (ORCPT ); Mon, 9 Apr 2018 12:42:13 -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 777FC1529; Mon, 9 Apr 2018 09:42:13 -0700 (PDT) Received: from e108498-lin.cambridge.arm.com (e108498-lin.cambridge.arm.com [10.1.210.38]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id F05C83F24A; Mon, 9 Apr 2018 09:42:10 -0700 (PDT) Date: Mon, 9 Apr 2018 17:42:06 +0100 From: Quentin Perret To: Peter Zijlstra Cc: Dietmar Eggemann , linux-kernel@vger.kernel.org, Thara Gopinath , linux-pm@vger.kernel.org, Morten Rasmussen , Chris Redpath , Patrick Bellasi , Valentin Schneider , "Rafael J . Wysocki" , Greg Kroah-Hartman , Vincent Guittot , Viresh Kumar , Todd Kjos , Joel Fernandes Subject: Re: [RFC PATCH 2/6] sched: Introduce energy models of CPUs Message-ID: <20180409164205.GA3520@e108498-lin.cambridge.arm.com> References: <20180320094312.24081-1-dietmar.eggemann@arm.com> <20180320094312.24081-3-dietmar.eggemann@arm.com> <20180409120111.GA4043@hirez.programming.kicks-ass.net> <20180409134510.GA4577@e108498-lin.cambridge.arm.com> <20180409153233.GA4082@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180409153233.GA4082@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.8.3 (2017-05-23) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Monday 09 Apr 2018 at 17:32:33 (+0200), Peter Zijlstra wrote: > On Mon, Apr 09, 2018 at 02:45:11PM +0100, Quentin Perret wrote: > > > In this specific patch, we are basically trying to figure out the > > boundaries of frequency domains, and the power consumed by each CPU > > at each OPP, to make them available to the scheduler. The important > > thing here is that, in both cases, we rely on the OPP library to > > keep the code as platform-agnostic as possible. > > AFAICT the only users of this PM_OPP stuff is a bunch of ARM platforms. That's correct. > Granted, body else has build a big.little style system, so that might > all be fine I suppose. > > It won't be until some !ARM chip comes along that we'll know how > generically usable any of this really is. > Right. There is already a lot of diversity in the Arm ecosystem that has to be managed. That's what I meant by platform-agnostic. Now, I agree that it should be discussed whether or not this is enough for other archs ... It might be reasonable to expect from the archs who want to use EAS that they expose their OPPs in the OPP lib. That should be harmless, and EAS needs to know about the OPPs, so they should be made visible, ideally somewhere generic. Otherwise, that means the interface with the EAS has to be defined only by the energy model data structures, and the actual energy model loading procedure becomes free-form arch code. I quiet like the first idea from a pure design standpoint, but I could also understand if maintainers of other archs were reluctant to have new dependencies on PM_OPP ... > > In the case of the frequency domains for example, the cpufreq driver is > > in charge of specifying the CPUs that are sharing frequencies. That > > information can come from DT, or SCPI, or SCMI, or whatever -- we > > probably shouldn't have to care about that from the scheduler's > > standpoint. That's why using dev_pm_opp_get_sharing_cpus() is handy, > > the OPP library gives us the digested information we need. > > So I kinda would've expected to just ask cpufreq, that after all already > knows these things. Why did we need to invent this pm_opp thing? Yes, we can definitely rely on cpufreq for this one. There is a "strong" dependency on PM_OPP to get power values, so I decided to use PM_OPP for the frequency domains as well, for consistency. But I can change that if needed. > > Cpufreq has a tons of supported architectures, pm_opp not so much. > > > The power values (dev_pm_opp_get_power) we use right now are those > > already used by the thermal subsystem (IPA), which means we don't have > > I love an IPA style beer, but I'm thinking that's not the same IPA, > right :-) Well, both can help to chill down in a way ... :-) The IPA I'm talking about means Intelligent Power Allocator. It's a thermal governor that uses a power model of the platform to allocate power budgets to CPUs & GPUs using a control loop. The code is in drivers/thermal/power_allocator.c if this is of interest. > > > to introduce any new DT binding whatsoever. In a close future, the power > > values could also come from other sources (SCMI for ex), and again it's > > probably not the scheduler's job to care about those things, so the OPP > > library is helping us again. As mentioned in the notes, as of today, this > > approach has dependencies on other patches relating to these things which > > are already on the list [1]. > > Is there any !ARM thermal driver? (clearly I'm not up-to-date on things > thermal). I don't think so. Thanks, Quentin