From patchwork Mon Mar 1 06:51:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 12108801 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=-11.8 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,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 52195C433DB for ; Mon, 1 Mar 2021 06:52:45 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 DC6CE60232 for ; Mon, 1 Mar 2021 06:52:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DC6CE60232 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=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject: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=LErI0ECBKpCo5KVmM4gBbQDSOSTVfN8ro4PmsgcIbB8=; b=XBaUijgpzhiuie5R8h4j3rSjim GfI7Z7xvUO3IcUcIricmn+gb4YCv10eq4X9Z1Sy2c0Ka9W3wKToS0IzoGt64EbdYAV0dzkFvqFU0p ppjw26ij3AGxMbpr6AIY8CYvlneW3XFmfNCDfdyckmSM2HIslX8BPVrSVgRKsGGypNEQi96gtwMvv GqX/Ub6zKBJYUSbBn7SojJu1h3KIz4AeKJr4iSabp3Pi1zzEilqmD0hq1G3GcI2sUQG69CEyYniT6 ZM9t5JO61plNzk5GO4UPvgnDRASePRU4JJh4l/gzsZyiagJ19t+Gj064Za2pdXRbTUX74Ffgdd0ww 1JaUuQ9w==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1lGcOw-0000k6-PU; Mon, 01 Mar 2021 06:51:30 +0000 Received: from mail-pj1-x102e.google.com ([2607:f8b0:4864:20::102e]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1lGcOt-0000hl-JC for linux-arm-kernel@lists.infradead.org; Mon, 01 Mar 2021 06:51:29 +0000 Received: by mail-pj1-x102e.google.com with SMTP id b15so10431567pjb.0 for ; Sun, 28 Feb 2021 22:51:25 -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=HKJcnmCx4sYduX4bzxa7WXAlgUMDP/L6tO/2tpAiHHjxNf93uzDp8aXF0TaWoaYcVB Aqu+n1xItiphGIBw7lN3vf9sSprz23U2Kt/Z5TbL1PQFp/HiFLtCyIWhjcfkDJQKbxSh uCivkZVr5+Pm9UeD3+KSZqITPsfWsv0Dbu3hBa9qN95DiV6BjEw3L5xy02ywR9iY69sq SnmvlWubiJnsGqaBTnikQDVoPymejg56rv5tXiCyAboI/WP2SYlKN8CaeG+Uhue1ierX AN2+KYsIvPWRwFekS6HSUAZNtj2Xz0t8LfvX5VjefQNETSDQihMmfeZYVWdyvotx61n4 vrRA== X-Gm-Message-State: AOAM531KmPSLmGP4K6Uns1t5a3QuW4CmRQFxetE4J/Tew8obQF0XtL7C xbPcKYTBIBhQtBTDygdbmk8Gjg== X-Google-Smtp-Source: ABdhPJyyeDkeZLl+9Bb9rZkhCqorIxui0T4q6log1k/2GJaVJJkHpEqq2xxfCVbgDiTyFMHDKRdJNg== 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210301_015127_924281_0DDE4DF3 X-CRM114-Status: GOOD ( 17.15 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-acpi@vger.kernel.org, Ionela Voinescu , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org 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: - /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