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: 12127021 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1549FC433E0 for ; Wed, 10 Mar 2021 05:27:34 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9F11664FEF for ; Wed, 10 Mar 2021 05:27:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9F11664FEF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=RNraxeKDofvAO5EM9AaSQDQU8LYdWP1aIPGxSnvuKbQ=; b=NlC5NGdDHZARAr/lKd6sI1D8wb ua9AqN7pGWLJODqJWwzf7mjC100iOIWESrFpNyJLkhPSR6orwcYtCpXBLL05Dc/oxpoYnSU6kzzBB m9ycsVvRFqwoop+Nz6NA3dYWHe26Dw8sa9FRQUl8XizWOp5L3d/xLOh19GD4DTnUd19keolp+jhHC /djn1/twj5Z1i/mTmZEdO7GiTUS54jMIaWFclNjApseWsvnqlXreGfFNs1FNR4EnF5EHjp9TaabvV 7b2vQoRkbIVEpQEI8LLC3baYzXOH4+qRAAb+Ut5RPJFxTc6ik5LidX08klbMQYkczQraBONVdP9KF 0U9vqBNw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lJrME-00649W-Oi; Wed, 10 Mar 2021 05:26:07 +0000 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lJrJv-0063wS-IT for linux-arm-kernel@lists.infradead.org; Wed, 10 Mar 2021 05:24:29 +0000 Received: by mail-pj1-x1032.google.com with SMTP id kr3-20020a17090b4903b02900c096fc01deso6830450pjb.4 for ; Tue, 09 Mar 2021 21:23:41 -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=FkHCWJF+uXVB46XF905wwn1tODjCBtTDDdKAPkwZLLNm5ua5fewlZ9XirMXLrc3Axh Ag8LW6drFWLE758kRvTuC6+4RS2BHAxiWVertfccQyJp32nGFr6f5viN6dE3NjuexDOe /N9HHmXWON0WWiikW9X5vqeWmiGdwFiEXuLZAIN2lcryp/MiZmiiWWAauf94WK55wyCX HJSfRl5DJkXu78bJj1TdMDJuKGeMcxHy7VhX15+cVcN/yxpXO6/WGRDgekgBZ12tbhVP ADA7X9vxHkiW0tCDzljzT9rCXXD+Kqamz6er1jqQPLY6F9OOyuFjZTZbtoO/d82tifSp rSew== X-Gm-Message-State: AOAM530Niy/o4rXDHPF/LJJ9T634wrZMV7SzpuzBBAdPRDCCjRkoZqmB 461MJgjF04GDNli+jx9I75BUIw== X-Google-Smtp-Source: ABdhPJzuL00Zp+tBMXN7pBV0GvYvFgNsl98h+A5+Yaf3P8yLznthV781A8esUxFwRezpcnDhfzruig== 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210310_052426_485958_EA2D5A8D X-CRM114-Status: GOOD ( 20.51 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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