From patchwork Thu Jan 28 10:48:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 12053347 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=-13.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham 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 1C003C433DB for ; Thu, 28 Jan 2021 10:49:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C074664DD8 for ; Thu, 28 Jan 2021 10:49:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231231AbhA1Ktp (ORCPT ); Thu, 28 Jan 2021 05:49:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231152AbhA1Ktm (ORCPT ); Thu, 28 Jan 2021 05:49:42 -0500 Received: from mail-pf1-x431.google.com (mail-pf1-x431.google.com [IPv6:2607:f8b0:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80F5EC061574 for ; Thu, 28 Jan 2021 02:49:02 -0800 (PST) Received: by mail-pf1-x431.google.com with SMTP id j12so3723232pfj.12 for ; Thu, 28 Jan 2021 02:49:02 -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=v8tY7xOSVL8TKmu23l5iwSWLMDTVdZzvIWOkVTMFGtE=; b=GOVFFIZleKeu/u0ClRM2qZBnFQcwtfJ8rA2iqIzKh4pprvawvMHg+/qykqmwoO4Qv6 wx5VoD8JLCNalnmcuv46OFtu0o96/BWOseUB+v/QBLExW4R3c2nq2iA1VA2xUTYZbu5r Rd6vqPsDA6dhwCO3+h4J4lGF7AkGQ4jl3FGuvCNyniC6VwNLOWVtUcJ2X/OLD6RHs9g2 mzkLcdThwlY++oad1iemBQy65e0FdneukoyiNpD7I6+9tC7m0Bn2pfwtZ7j5A41pNufT xzw9TUQVwy5Qdz6My0hZ6zqsN1wz2VUNLJTJN/2l+9yX2gJRBUTmvdiJ2m37syVS/mC6 HNaA== 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=v8tY7xOSVL8TKmu23l5iwSWLMDTVdZzvIWOkVTMFGtE=; b=b6nMQ4pcxy3Pn2xsj1hjbRCPbIPcfEkbKmKmUTG8Uua5TY9vznlFxYOWgYz7rbNFAO 1Z/J8u8AKL9xwJ9AQOk6bSLvP0q2/Iimvx3cZM8faWMPR05W9mQKxAdaEPkNQkl4cFRz xsx155GA7IhQ7M3Jb9BcRGOHXaer4NHqGgV2wU7xvNvRDU1kt4mkYQR1b+sgidozcXQt K4Tp1Kzwg70YEse15ngZsg/lupUko4FmXePYFFT3hnrfugdHBWuyiBSuY0v14Jzdmk0u V7Zn8x3raCVke6exenVX1wcDGDFeRd1Qy5hUEABXr/bD1i8WzKINbdjQUXtm5rAMjl+w bOgg== X-Gm-Message-State: AOAM533l23o26fjDYf8IaFtkakU/tykK0306eqwf+mnnD5NdJQ44CDru y8Ysnb8Clm+wgR3CvIcPYlfpPQbjIC3eMg== X-Google-Smtp-Source: ABdhPJwa+ZzBlBpHuDnGeZby0eouiQdqpT0URVUu78gQU8t16ZFZ3MV/GorfSzD1iZ9T/VN5tnBVxQ== X-Received: by 2002:a63:1a48:: with SMTP id a8mr16032597pgm.257.1611830942070; Thu, 28 Jan 2021 02:49:02 -0800 (PST) Received: from localhost ([122.172.59.240]) by smtp.gmail.com with ESMTPSA id a30sm5378756pfh.66.2021.01.28.02.49.00 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Jan 2021 02:49:01 -0800 (PST) From: Viresh Kumar To: Ionela Voinescu , Rafael Wysocki , Catalin Marinas , Will Deacon Cc: Viresh Kumar , Vincent Guittot , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org, Sudeep Holla , Greg Kroah-Hartman Subject: [PATCH V3 0/2] cpufreq: cppc: Add support for frequency invariance Date: Thu, 28 Jan 2021 16:18:54 +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 with some hacks, as I didn't have access to the right hardware, on the ARM64 hikey board to check the overall functionality and that works fine. Vincent/Ionela, it would be nice if you guys can give this a shot on some real hardware where counters work. This is based of pm/linux-next (need some stuff from the arm64 tree). These patches should get merged via the arm64 tree only for the same reason. 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 | 89 +++++++-------- drivers/base/arch_topology.c | 56 +++++++++- drivers/cpufreq/cppc_cpufreq.c | 179 ++++++++++++++++++++++++++++-- include/linux/arch_topology.h | 15 ++- kernel/sched/core.c | 1 + 6 files changed, 274 insertions(+), 76 deletions(-)