From patchwork Mon Feb 22 11:18:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 12098357 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,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 3BCB0C433E0 for ; Mon, 22 Feb 2021 11:20:15 +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 CB67364D79 for ; Mon, 22 Feb 2021 11:20:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CB67364D79 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=HfbcvoNdn0uTCZpLZzGogV/8NvIgs6J7Z1ZN8UNoc70=; b=JQwtKcoT2Ju88C0jX2EopHTemu dZHw4GmKTqa2fz99yePj40YKVqJKY4HjI3jBPxEcflJ4nmPGRBTuv/KuXldxXz6aL6Frzmunk4ybo 9+nfIYW/YWC+i1HRHQx5ZKXQgkdi2BC//M8N0AgmrsOWZD0BC5cOKsrpzhLF3Lc9fI+hjo9Syeb22 m3PdcRy6m825eH2VUAsw6zpBz6bjZ8heNQJIBb3L0ouxRfbo5cHl4JJKVhOf8rijRcP5aTdgu4Y6w xzhoE/HAjiOoxhAJor8kZgWWBeTfajLPFmpummNYH9y/wGRohTwTK3JQWmOehA0DrK953b9a2M85h XAjAQzEw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1lE9Eo-0004Jk-9W; Mon, 22 Feb 2021 11:18:50 +0000 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1lE9El-0004I7-NX for linux-arm-kernel@lists.infradead.org; Mon, 22 Feb 2021 11:18:48 +0000 Received: by mail-pl1-x62a.google.com with SMTP id k22so7532221pll.6 for ; Mon, 22 Feb 2021 03:18:35 -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=rT96flgGp5OXr1BQHnPn+JClqj+1qV978OMJSYTUtHQ=; b=r+pugnSlMzO9/whuAbuvV5dfvU5Y1oqzQuzm8lKfQhRHer8acz6gQ7aGPF4xtN/UTw MJ5nEGcRJca5DrDNPJ5LNkczS2mNm8ali/Gq/Fz/G+zjmQ3vATonWXN6i0v302XW4QHq t3pAU3puYSJ4u+1t9ppsqnZH43pND5wg+MIG1HyC/47s3GMvuJPafa6RFHO39g3c3kzD ClvWosBsc9ngTx8vmpvSdT7FSz+DKfKXYYHbE2MYq2efxmZbn4LcJJFjSEUqIgoMP/qH OXUNswb/APCqZHKhG+oC3sy4R6kZ15BOZxkpjY0mDX7PBmmdB3J2j98ExS6gUnhdzzUr npgA== 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=rT96flgGp5OXr1BQHnPn+JClqj+1qV978OMJSYTUtHQ=; b=hRK7sWLTp9bTZq/3pomIk0Wxew82P0l341sm2og+UbjV2FX996qD7vvQmeC7XrY5Fj hZevZHCtO2zySZ32/O0ITUSLMqthPRC+rkv7R7dmAELyU5lcZQJfoj2FzQAW6T4XJ2gY rkGqWeslQAwQrZt/tAQFqe6rVZpIOF27cNKJtU7/CWGRMO8fbs8y/jHSoLJh2/52SIaf eLc3q3dIF6cIssf0/LdyEckHhxq8IbdiZ974DVbOUkcFtkoKHjq1hIaqYbt3YLcXaiXx dJ1n+yWAq1MoDPsmOOClXsTN1pAK37C3YLaMnRvclm9qkbwRDmxVDJvaSxYMkUsEgevS 46xg== X-Gm-Message-State: AOAM531ZpXHOmBYJAvMfl8HtBoiaTKWPYMkg/7JjVM7t6ps9vIfadbIq PHTCjA71SzUvAmKjgUEaCWqG1g== X-Google-Smtp-Source: ABdhPJzXB2R/XDyfm6GME0jPvQ11lpNLYhTZ5C2gruN6UBmTlLWwPeFuBooazJt/UvqXQqGPA0Xczg== X-Received: by 2002:a17:902:a5c4:b029:e3:e9c7:dcfb with SMTP id t4-20020a170902a5c4b02900e3e9c7dcfbmr7450185plq.34.1613992713816; Mon, 22 Feb 2021 03:18:33 -0800 (PST) Received: from localhost ([122.172.59.240]) by smtp.gmail.com with ESMTPSA id 25sm19403682pfh.199.2021.02.22.03.18.33 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Feb 2021 03:18:33 -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 V4 0/2] cpufreq: cppc: Add support for frequency invariance Date: Mon, 22 Feb 2021 16:48:21 +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-20210222_061847_809076_66160456 X-CRM114-Status: GOOD ( 17.34 ) 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: 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 so far. - Ionela Voinescu on Juno R2, though she tested the previous version of this. This is based of Linus's current master (so we will able to apply this on 5.12-rc1). 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 | 223 ++++++++++++++++++++++++++++-- include/linux/arch_topology.h | 15 +- kernel/sched/core.c | 1 + 7 files changed, 356 insertions(+), 92 deletions(-)