Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7400145ybi; Thu, 1 Aug 2019 07:38:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqy6gAy3T038n2B3u1DJzvdQZ3A3mp7YXXytXiEpZKxp8JQQ1SC5c+RIXnR12SywfYZvm7tn X-Received: by 2002:a63:6947:: with SMTP id e68mr83907632pgc.60.1564670307946; Thu, 01 Aug 2019 07:38:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564670307; cv=none; d=google.com; s=arc-20160816; b=ddC1Wi+O+YUaC5nvKXkLIen+HwR2axwEQiXGkULmPZf71bWJvroBK3Nm4bHHmB7VtQ bcpy1MBB7XRguCkf4fH3vtC1yhbPQOTHeu2hRmGRzoUYUJ92Np7RKfhz9FeRdayrVuTq PklNjckyi8f0440lDbxz+Akcy1o1sFNlbPkKvnru0et74T12BLmAmVCd/psg6mxlqiwE coD4hYyZ9US515kYgv3MCdLxRLc/gEIzXiWhzh1TVqOw9wY4Z/Dev+lof/sWHKE1iHXN NEpfyAG+3eRhBsStNSIQbIQ2AANRuybZeLi034HAs5XoK0wnQYLTLMkZIG/FK1zN7tpL KmMw== 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:autocrypt:openpgp:from:references:cc:to:subject :dkim-signature; bh=yMpiQpFWP0JEpjMoJk++KflIBeJTz7OVMNcADVho+R4=; b=AsWMj5tyYrDFwOedqasUqUwmSs5nKjUAbMvVbKVk7k3EcjR0rbgfFCkXGqTbynDc1z dIovQVrtlqFvKFM0lINvwHjEGV4yIbVw1Aat0XCFdTtaPdf0SEu0ESai2lsbl3KihJTw XrR/5L9Gzr2bQHLTfW9rlYZJhpgs5+Mn5JI5ZC7DulTWjECfNBQSuBUv8MY0XzG+WgPF Yy/4d6QP3HHBYwXfUNaxtswIY9Gliy7Ot30asCTIZDpKAg2U1YMVvWXO5quzHpRND5jC zvCaJokuMtAxceujQe8iEgRBlEroOY2NbAwt7yALl8PHoeT7d5ecIkuFTMfAjdYo+gdw JLgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tQEPWaf+; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l2si35609828pff.221.2019.08.01.07.38.11; Thu, 01 Aug 2019 07:38:27 -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; dkim=pass header.i=@linaro.org header.s=google header.b=tQEPWaf+; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731536AbfHANAR (ORCPT + 99 others); Thu, 1 Aug 2019 09:00:17 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:40274 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726422AbfHANAQ (ORCPT ); Thu, 1 Aug 2019 09:00:16 -0400 Received: by mail-wr1-f67.google.com with SMTP id r1so73472402wrl.7 for ; Thu, 01 Aug 2019 06:00:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:openpgp:autocrypt:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=yMpiQpFWP0JEpjMoJk++KflIBeJTz7OVMNcADVho+R4=; b=tQEPWaf+dZ44fnfNJxwvsG2mixMHkX/vyi1jSiPbobc/LJE39WeKWzQVqlZGq9Ir15 fBXgjk9onNi6OM+FBuKnrRSrNqwcQmA9B7klNceOZOm8qa8HXu022oiog07bbJpU+3kM KXjpbRxkZnXUTsbH69ijQXC+V/FLziitF5nfpucubq31QmoLewCvkrFTvpQ07gv7gtQz r38l9N40LxcNjyWE5S/crKcJTLprMelNTS+iNhS+JT38jGD9Jj6xMNgShyVOF+zRdDMn H/S9cG1Q+PgbyMN+iYQr2ugXNYYWLwU/luV7B7Ynl3p8tH580ID9NHHyqEYkj5cSc8lZ Drpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=yMpiQpFWP0JEpjMoJk++KflIBeJTz7OVMNcADVho+R4=; b=GvAmLJ1CKqzxg8Hgh/Xn6KLhEkhDfAvUNqcjPRpI+uBXc4lJlTOevwXopNMjWGQgYJ poNrAGCTQMecxOSjuLvA+etOyQU1U5Pc38hRRuC1KMQb6uxHnk+cYptO2f/RYHQLuOq+ zU9/cgCpVkm8BS0kz1z8WCjuhw0fL41A/0xpfoG5cZ+P750sHJzcWUsXcAJMcl7Q2Lhu pmgqzF3VJMRI9KUpFLn+36tEsNNNJrtIny/Y5wn6fivDstEY5zSTZqHIWp8KKB+G2v1x ZowCFYaXl0+IVSOXUNqondWYdtE6CoELE6MRCzRAXkSaCXOgPOtLKRHYmoysErbgtM+p 9SgA== X-Gm-Message-State: APjAAAWh5oSKXWDS2igYTQBltCwXaWNsSF//DYotx0oB+++3eeFogSnd +ozTRCUW0MXXkQg7ae0cMex82g== X-Received: by 2002:adf:eb49:: with SMTP id u9mr21570883wrn.215.1564664412103; Thu, 01 Aug 2019 06:00:12 -0700 (PDT) Received: from ?IPv6:2a01:e34:ed2f:f020:2166:4c76:28f8:762a? ([2a01:e34:ed2f:f020:2166:4c76:28f8:762a]) by smtp.googlemail.com with ESMTPSA id 4sm163635864wro.78.2019.08.01.06.00.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Aug 2019 06:00:11 -0700 (PDT) Subject: Re: [PATCH v6 0/3] Make IPA use PM_EM To: Quentin Perret , edubezval@gmail.com, rui.zhang@intel.com, javi.merino@kernel.org, viresh.kumar@linaro.org, amit.kachhap@gmail.com, rjw@rjwysocki.net, catalin.marinas@arm.com, will@kernel.org Cc: dietmar.eggemann@arm.com, ionela.voinescu@arm.com, mka@chromium.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org References: <20190801124643.17112-1-quentin.perret@arm.com> From: Daniel Lezcano Openpgp: preference=signencrypt Autocrypt: addr=daniel.lezcano@linaro.org; prefer-encrypt=mutual; keydata= mQINBFv/yykBEADDdW8RZu7iZILSf3zxq5y8YdaeyZjI/MaqgnvG/c3WjFaunoTMspeusiFE sXvtg3ehTOoyD0oFjKkHaia1Zpa1m/gnNdT/WvTveLfGA1gH+yGes2Sr53Ht8hWYZFYMZc8V 2pbSKh8wepq4g8r5YI1XUy9YbcTdj5mVrTklyGWA49NOeJz2QbfytMT3DJmk40LqwK6CCSU0 9Ed8n0a+vevmQoRZJEd3Y1qXn2XHys0F6OHCC+VLENqNNZXdZE9E+b3FFW0lk49oLTzLRNIq 0wHeR1H54RffhLQAor2+4kSSu8mW5qB0n5Eb/zXJZZ/bRiXmT8kNg85UdYhvf03ZAsp3qxcr xMfMsC7m3+ADOtW90rNNLZnRvjhsYNrGIKH8Ub0UKXFXibHbafSuq7RqyRQzt01Ud8CAtq+w P9EftUysLtovGpLSpGDO5zQ++4ZGVygdYFr318aGDqCljKAKZ9hYgRimPBToDedho1S1uE6F 6YiBFnI3ry9+/KUnEP6L8Sfezwy7fp2JUNkUr41QF76nz43tl7oersrLxHzj2dYfWUAZWX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8zgFr/pxH5CbYJDk0 tYUhisTESeesbvWSPO5uNqqy1dAFw+dqRcF5gXIh3NKX0gqiAA87NM7nL5ym/CNpJ7z7nRC8 qePOXubgouxumi5RQs1+crBmCDa/AyJHKdG2mqCt9fx5EPbDpw6Zzx7hgURh4ikHoS7/tLjK iqWjuat8/HWc01yEd8rtkGuUcMqbCi1XhcAmkaOnX8FYscMRoyyMrWClRZEQRokqZIj79+PR adkDXtr4MeL8BaB7Ij2oyRVjXUwhFQNKi5Z5Rve0a3zvGkkqw8Mz20BOksjSWjAF6g9byukl CUVjC03PdMSufNLK06x5hPc/c4tFR4J9cLrV+XxdCX7r0zGos9SzTPGNuIk1LK++S3EJhLFj 4eoWtNhMWc1uiTf9ENza0ntqH9XBWEQ6IA1gubCniGG+Xg== Message-ID: Date: Thu, 1 Aug 2019 15:00:10 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190801124643.17112-1-quentin.perret@arm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Rui, is it possible to merge these patches? They are acked-by since May. Thanks -- Daniel On 01/08/2019 14:46, Quentin Perret wrote: > Changes in v6 > ************* > - Added Daniel's and Viresh's Acked-by to all patches > > Changes in v5: > ************** > - Changed patch 02 to guard IPA-specific code in cpu_cooling.c with > appropriate ifdefery (Daniel) > - Rebased on 5.2-rc2 > > Changes in v4: > ************** > - Added Viresh's Acked-by to all 3 patches > - Improved commit message of patch 3/3 to explain how it has no > functional impact on existing users (Eduardo) > > Changes in v3: > ************** > - Changed warning message for unordered tables to something more > explicit (Viresh) > - Changed WARN() into a pr_err() for consistency > > Changes in v2: > ************** > - Fixed patch 01/03 to actually enable CONFIG_ENERGY_MODEL > - Added "depends on ENERGY_MODEL" to IPA (Daniel) > - Added check to bail out if the freq table is unsorted (Viresh) > > Cover letter: > ************* > > The Intelligent Power Allocator (IPA) thermal governor uses an Energy > Model (or EM) of the CPUs to re-distribute the power budget. To do so, > it builds a table of tuples where the power values > are computed using the 'dynamic-power-coefficient' DT property. All of > this is done in and only for the thermal subsystem, and more > specifically for CPUs -- the power of other types of devices is obtained > differently. > > Recently, the CPU scheduler has seen the introduction of Energy Aware > Scheduling (EAS) patches, which also rely on an EM of the CPUs. This EM, > however, is managed by an independent framework, called PM_EM, aimed to > be used by all kernel subsystems interested in the power consumed by > CPUs, and not only the scheduler. > > This patch series follows this logic and removes the (now redundant) > thermal-specific EM computation code to migrate IPA to use PM_EM > instead. > > Doing so should have no visible functional impact for existing users of > IPA since: > > - during the 5.1 development cycle, a series of patches [1] introduced > in PM_OPP some infrastructure (dev_pm_opp_of_register_em()) enabling > the registration of EMs in PM_EM using the DT property used by IPA; > > - the existing upstream cpufreq drivers marked with the > 'CPUFREQ_IS_COOLING_DEV' flag all call dev_pm_opp_of_register_em(), > which means they all support PM_EM (the only two exceptions are > qoriq-cpufreq which doesn't in fact use an EM and scmi-cpufreq which > already supports PM_EM without using the PM_OPP infrastructurei > because it read power costs directly from firmware); > > So, migrating IPA to using PM_EM should effectively be just plumbing > since for the existing IPA users the PM_EM tables will contain the > exact same power values that IPA used to compute on its own until now. > The only new dependency is to compile in CONFIG_ENERGY_MODEL. > > Why is this migration still a good thing ? For three main reasons. > > 1. it removes redundant code; > > 2. it introduces an abstraction layer between IPA and the EM > computation. PM_EM offers to EAS and IPA (and potentially other > clients) standardized EM tables and hides 'how' these tables have > been obtained. PM_EM as of now supports power values either coming > from the 'dynamic-power-coefficient' DT property or obtained > directly from firmware using SCMI. The latter is a new feature for > IPA and that comes 'for free' with the migration. This will also be > true in the future every time PM_EM gets support for other ways of > loading the EM. Moreover, PM_EM is documented and has a debugfs > interface which should help adding support for new platforms. > > 3. it builds a consistent view of the EM of CPUs across kernel > subsystems, which is a pre-requisite for any kind of future work > aiming at a smarter power allocation using scheduler knowledge about > the system for example. > > [1] https://lore.kernel.org/lkml/20190204110952.16025-1-quentin.perret@arm.com/ > > > Quentin Perret (3): > arm64: defconfig: Enable CONFIG_ENERGY_MODEL > thermal: cpu_cooling: Make the power-related code depend on IPA > thermal: cpu_cooling: Migrate to using the EM framework > > arch/arm64/configs/defconfig | 1 + > drivers/thermal/Kconfig | 1 + > drivers/thermal/cpu_cooling.c | 428 ++++++++++++++-------------------- > 3 files changed, 178 insertions(+), 252 deletions(-) > -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog