From patchwork Wed Mar 10 05:23:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 396666 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp92275jai; Tue, 9 Mar 2021 21:24:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJwMYBVg4geYwhfSR+rYg7YzuEP1zreVk0eyHnk8jpbwxZus6xCYh1dKTAFSh6d7OxMqIz5u X-Received: by 2002:aa7:d511:: with SMTP id y17mr1214263edq.275.1615353880126; Tue, 09 Mar 2021 21:24:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615353880; cv=none; d=google.com; s=arc-20160816; b=ZGkq0HKIy9PZGudctuEKs8wPLpDA8UJ3ztmBj7EJ8jcihJyalrPiG1mVwU7AKwldk3 FjLWbsyohjaCj4XAATeia4PHYlnL3s+BGckRB+5znokDIWyZ+xtw77xUrmUPXZynbU3J azwP0VABXZTqrlNKSJZqNNyn4P5DwVYbmDU+v3LNW0inwFbUdQRXBmbO6PzMILW3dMZO q7GNVef26XVYfLSR5UbuIBYHf4qLAXdNfuRwWKspGSGq4QMKrGPRgULAqqnCjm8xD85I FZAo9roP44hAL8AZ6gzmJGcdnhkMLGyAfgqsUh2cun8eCxyYKkI59QjFW22txJ3zoKDr WuBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=kzNfsTKHRqikZKDJpk3ZLLd8WdOKtskH70hYikTl5M4=; b=euuuwomArgI7kBuEWRofL+dbU/clhPFhuV7AB6+h0HMAnw7jGbTcmt1uzd1HJVkY57 mU8mcbFrfNBy8OaqqOqYKnF0HcnFw95a5ZoEQPbCxdkzpSxpA3Bepk1+QWyA/Se3fub/ VzGHxqZnOubS9/HdPpcKLNvBequFRPRUJNKhBe9Inm7jvYDSm0S1O9s7x/gYB16hBv7a tirGz7ri41vueWdb+62Czk+q24w0zdR3plAe74o9SAS8pgefUtUZs/oFRh9EsDP95/uh mMrvCwdKTk4mDeo4rkwUfJAWBQr/s3zn8GXvlEs5ZXp5YRHS2NLMi1EnjvFNWIzlKGRB hR+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lYvgYuHQ; spf=pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-pm-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. [23.128.96.18]) by mx.google.com with ESMTP id u19si10720380edq.33.2021.03.09.21.24.39; Tue, 09 Mar 2021 21:24:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lYvgYuHQ; spf=pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-pm-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 S229470AbhCJFYF (ORCPT + 7 others); Wed, 10 Mar 2021 00:24:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54290 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229483AbhCJFXl (ORCPT ); Wed, 10 Mar 2021 00:23:41 -0500 Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E50C9C061761 for ; Tue, 9 Mar 2021 21:23:40 -0800 (PST) Received: by mail-pj1-x1036.google.com with SMTP id gb6so924895pjb.0 for ; Tue, 09 Mar 2021 21:23:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=kzNfsTKHRqikZKDJpk3ZLLd8WdOKtskH70hYikTl5M4=; b=lYvgYuHQ+43IDf50Nw1EmBSIyL7fXfv4Nr3KnquWOQck0aXiXI0d4TTDuMmJ5K/8ls gT2RRp5DI35ogBnizM4GiIE/LF4cTmFh9/3vyHwU/OaX8HMhGlxkAVxy1T54sBYbTy7o uPcjlLO8QPgoLl/3mh2tZyVwEkY3TqgtZYFMvOiF+IXDX10DQzE5Qm4rRrG+evkDYR+q 2Dgt9UNJ1m59MfPiMwGxHFxKJrR1bR1r0I6NU0W7JkXfXOPBXpbb9xfuWTzx4qTy/U4z g7lQ27S/9Ae58/q69oDcKy25XqJmIBTx0/sR3R8JjbDF/+LL7c620nyyEirBH4a9Tzl4 0kVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=kzNfsTKHRqikZKDJpk3ZLLd8WdOKtskH70hYikTl5M4=; b=dwhQXWS5vRc3pkdz7W0vc5execKv5TJXa+RfdcFkCRukFcmgWkhpcXFfd9pWc5CTuT ZKTQsAKFDx9pjUggtTKDI5rjC3c15udbPSJnextP4a1TYQEgArXrW9X7A0EKj3IkahZE YSzu26iMlc6LsUiu17A7MrIZXHzFOAHkJozwcGXnBY6stKvpkuIW8b6JE1pv7fb0MWK0 k+qHLgHjOmxk8smHB8JClLkKKgnNuwd01EKM4LVxFuwx6HJPc9FUKj/sK2hpFPXrdJ6n 4FOwS8ue3XpM8BM4O6C0rQVL4XH5hIB1PJLPYHgMLvpHWQ88qMNgJJyOIRXpgyrMpujR q9dA== X-Gm-Message-State: AOAM530BjSS8aN1fi4MwmHL/7I4MZ2nKrHalV9Mj/pmvkO3Wonf1463z uB7+lsbg7M7+OSUZhVHmUiHeFg== X-Received: by 2002:a17:902:b08b:b029:e4:deb:69a9 with SMTP id p11-20020a170902b08bb02900e40deb69a9mr1241127plr.35.1615353820285; Tue, 09 Mar 2021 21:23:40 -0800 (PST) Received: from localhost ([122.171.124.15]) by smtp.gmail.com with ESMTPSA id u9sm14776075pgc.59.2021.03.09.21.23.39 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Mar 2021 21:23:39 -0800 (PST) From: Viresh Kumar To: Rafael Wysocki , Ben Segall , Catalin Marinas , Daniel Bristot de Oliveira , Dietmar Eggemann , Greg Kroah-Hartman , Ingo Molnar , Juri Lelli , Mel Gorman , Peter Zijlstra , "Rafael J. Wysocki" , Steven Rostedt , Sudeep Holla , Vincent Guittot , Viresh Kumar , Will Deacon Cc: linux-pm@vger.kernel.org, Ionela Voinescu , linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH V6 0/4] cpufreq: cppc: Add support for frequency invariance Date: Wed, 10 Mar 2021 10:53:22 +0530 Message-Id: X-Mailer: git-send-email 2.25.0.rc1.19.g042ed3e048af MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Hello, CPPC cpufreq driver is used for ARM servers and this patch series tries to provide counter-based frequency invariance support for them in the absence for architecture specific counters (like AMUs). This is tested by: - Vincent Guittot on ThunderX2. - Ionela Voinescu on Juno R2. - /me with hacks on Hikey, as I don't have access to the right hardware. This is based of 5.12-rc2. I will merge these via the arm-cpufreq tree directly. Changes since V5: - New patch to rename freq_scale to arch_freq_scale (Will Deacon). - Separate patch to export arch_freq_scale and helpers (Will Deacon). - Some improvements in the last patch like commit log, moving more stuff to policy init, new fie_disabled flag, etc. (Ionela Voinescu). - Added Reviewed/Acked/Tested-by tags. Changes since V4: - Move some code to policy specific initialization for cppc driver. - Initialize kthread specific stuff only once in cppc driver. - Added a kerneldoc comment in cppc driver and improved changelog as well. Changes since V3: - rebuild_sched_domains_energy() stuff moved from arm64 to drivers/base. - Added Reviewed/Tested-by Ionela for the first patch. - Remove unused max_freq field from structure in cppc driver. - s/cppc_f_i/cppc_freq_inv. - Fix an per-cpu access, there was a bug in earlier version. - Create a single kthread which can run on any CPU and takes care of work from all the CPUs. - Do the whole FIE thing under a new CONFIG option for cppc driver. - Few minor improvements. Changes since V2: - Not sending as an RFC anymore. - Several renames, reordering of code in 1/2 based on Ionela's comments. - Several rebase changes for 2/2. - The freq_scale calculations are optimized a bit. - Better overall commenting and commit logs. Changes since V1: - The interface for setting the callbacks is improved, so different parts looking to provide their callbacks don't need to think about each other. - Moved to per-cpu storage for storing the callback related data, AMU counters have higher priority with this. -- Viresh Viresh Kumar (4): arch_topology: Rename freq_scale as arch_freq_scale arch_topology: Allow multiple entities to provide sched_freq_tick() callback arch_topology: Export arch_freq_scale and helpers cpufreq: CPPC: Add support for frequency invariance arch/arm64/include/asm/topology.h | 10 +- arch/arm64/kernel/topology.c | 109 +++++-------- drivers/base/arch_topology.c | 89 ++++++++++- drivers/cpufreq/Kconfig.arm | 10 ++ drivers/cpufreq/cppc_cpufreq.c | 245 ++++++++++++++++++++++++++++-- include/linux/arch_topology.h | 19 ++- kernel/sched/core.c | 1 + 7 files changed, 385 insertions(+), 98 deletions(-) base-commit: a38fd8748464831584a19438cbb3082b5a2dab15 -- 2.25.0.rc1.19.g042ed3e048af