Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3030944pxb; Sun, 28 Feb 2021 22:54:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJx0MhR0vrFwzbQGajeavBfEzAxlsxVfiVx6Uqfhfu59HkirIR/+IjCKWynwUYqZB6szI7Zh X-Received: by 2002:a05:6402:11c6:: with SMTP id j6mr15415020edw.138.1614581699763; Sun, 28 Feb 2021 22:54:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614581699; cv=none; d=google.com; s=arc-20160816; b=DqDiMfH9bj6seX5tFza9iXRJbRyPN5etxJo+9kT2htuwPzXxNXtMKTKJ04UJHX9A2s d75FT7MjaeNzhluxViTy88ck1qPc4eXdOABZK2O25NAvMLZpWvH1asawLfoqid+SYINm y0Mbh5YaqW6pcZdWtvu0PwWSq6SbvGWopnTk4ALGXdS+ZYJXE3pTKW5FxYYhd9uEvXnR lrnCkNmz2+w5pZdvZ1XMbDJg58nK0L58GmvdTmC3mzoKk2QEpX7TqcWY22JJkMB00iXj 46wiAXtiNsh6ex2/eyxcu9yH441j0c+suDUxAagYKRQ/GcigZLOuAz7ayS63JMXURZgy ow0A== 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=aqYwd+HQ765ezIeB0Bc/wTGpv0fipfbf8xfki7p6edQ=; b=gtEN0XQCZAUY291PQ2pPxCF+2xPOrCf7AySqf+I+VVpCzQtwGuhURGit1OXtYKbPZB iEsjl+skxcMmV8GB0LpgZOyxTrjlroWlYqqnH+buodlyEFswqti13w19fkEN5eBw+kWL d4fZ8TqIE7QwQWeHNWFWDHAV+SnHTEcJ8FiwSVOOGb5Ov9n2C8ycyGLEp5BSLnx0+Z8S iyn8fYKPOK3Q7HumWTEL4nOxGfAr3kh0bO+KnxPhAT6a2h2p4EUEYkIkkSQmHEfoGJgs nJzfzOC3mGFuBT/LOnhrnF0YwRPBDkotZZD3kv9xEWPYUGOxDthc9CoTwWzW1CI84TSD CRNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Y631LNIj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id bz20si11024036ejc.351.2021.02.28.22.54.37; Sun, 28 Feb 2021 22:54:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-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=Y631LNIj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S232174AbhCAGw4 (ORCPT + 99 others); Mon, 1 Mar 2021 01:52:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53824 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232147AbhCAGwE (ORCPT ); Mon, 1 Mar 2021 01:52:04 -0500 Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 76F06C061788 for ; Sun, 28 Feb 2021 22:51:24 -0800 (PST) Received: by mail-pj1-x1033.google.com with SMTP id u12so10846002pjr.2 for ; Sun, 28 Feb 2021 22:51:24 -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=aqYwd+HQ765ezIeB0Bc/wTGpv0fipfbf8xfki7p6edQ=; b=Y631LNIj8XPs2GZZlzOu/pCAPkeV03yi0tSc90ZFqdWNq4MwxG2RTvBVvVI7L1qhLr DvAwJrrisVMtoRu9qYW0NODodR7cn0ldGEeIt5YpsHOyzJvEQ/Oig/cK4ucYwkVN9row ase1SDeTqqe3UZ5a66nc1bl9NZeZNErYMsQbajplFOmEw+rEFNg1uHE9Kh1kMofQOZWs E0L4wOnNiDQmCcYKoaB4apAqviTyz95oO3XfPlUhMeApoWbiasUEybs3nAoS/eYGD/KB qA4ZK7bL8Vf9mWEIlM1kwRveM0x9KHA6EW2B8gbovP2pjL73L5vTnmbRRQYfzfXcK7TK gnOQ== 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=aqYwd+HQ765ezIeB0Bc/wTGpv0fipfbf8xfki7p6edQ=; b=RQSXxI30IbgKtrw3bUyjtasEvZNsuevcZ8cfmh+6NAed0Pa8xCIsdFhG8V83iHW8xY mFLYCZ0S9f5S428j+xmKryDqOhosNoO0U5xG0V/TkUBanTfIKl9+M7hK9agWYSXL4ENC kS+wSfR99tWVA1/uNWrRlcYHrris5W+QRAmpiiSNVefABnUr0yq34a8/BvTbhbPOaNs0 VJVe2h143RjzfdK9dmcUiOgqang+p8LFB8igXc8uvYqYIR03NzfECsXmjAUfl3TC2ahS RD2Hxxw5CMa63Bx9lEgznAb6lOrTl16E8GRFTpUNNsNWHOmJ98QgUyfEQgyhYruIh610 AaaQ== X-Gm-Message-State: AOAM533fqMCa07uVGQXZgNI/jhWGXH5usz4R76Ozb8OCy4acIIUSZKW7 8JZk0gw7+4jRgAk4PMjnKokuJg== X-Received: by 2002:a17:902:ce8d:b029:e4:bc38:c4 with SMTP id f13-20020a170902ce8db02900e4bc3800c4mr1231327plg.48.1614581483871; Sun, 28 Feb 2021 22:51:23 -0800 (PST) Received: from localhost ([122.171.124.15]) by smtp.gmail.com with ESMTPSA id x23sm16104211pff.133.2021.02.28.22.51.22 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 28 Feb 2021 22:51:23 -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 V5 0/2] cpufreq: cppc: Add support for frequency invariance Date: Mon, 1 Mar 2021 12:21:16 +0530 Message-Id: X-Mailer: git-send-email 2.25.0.rc1.19.g042ed3e048af MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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: - /me with some hacks on Hikey, as I didn't have access to the right hardware. - Vincent Guittot on ThunderX2, only initial testing done. - Ionela Voinescu on Juno R2, though she tested a previous version of this. This is based of 5.12-rc1. 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 (2): topology: Allow multiple entities to provide sched_freq_tick() callback cpufreq: CPPC: Add support for frequency invariance arch/arm64/include/asm/topology.h | 10 +- arch/arm64/kernel/topology.c | 105 +++++-------- drivers/base/arch_topology.c | 85 ++++++++++- drivers/cpufreq/Kconfig.arm | 9 ++ drivers/cpufreq/cppc_cpufreq.c | 244 ++++++++++++++++++++++++++++-- include/linux/arch_topology.h | 15 +- kernel/sched/core.c | 1 + 7 files changed, 377 insertions(+), 92 deletions(-) base-commit: fe07bfda2fb9cdef8a4d4008a409bb02f35f1bd8 -- 2.25.0.rc1.19.g042ed3e048af