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: 388620 Delivered-To: patch@linaro.org Received: by 2002:a02:290e:0:0:0:0:0 with SMTP id p14csp3120686jap; Sun, 28 Feb 2021 22:53:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJyMGpIGdKp0L8NAbsgxY39swpmzFTT96ixVt+sGkKAwSXhoQ1nxP8DCseEY6LNYhhKNzzIx X-Received: by 2002:a17:906:5acd:: with SMTP id x13mr14357435ejs.211.1614581607914; Sun, 28 Feb 2021 22:53:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614581607; cv=none; d=google.com; s=arc-20160816; b=GHtk3TaLVdlURAYS5Y9R8pNWSY5b1ie2zeA92kJnyANRBIRVL0C5UVV2037xgaeO2d Ms08tVCkQz+w0AcT1oCjatBnEO4qKbbQmfgNLCC5W09hBv3/D6HuC1hmRazKb5xU/31i PdQyFhU8N3YI3rXvyIAGMrivstGx45p7y0eqc8Kgh8MPq2RSluM3Y7McH6lAEZ//5MXt TL2XUqePRtSNd7c+UXcQ/gwUd8oxUuv4Gu498n24jghG6KQs/Md3OiNRtrU57K0V1e/S atUI0/MNbt5LFPriZQ83B0Gz6XotkLh5Wsxrrsr43lprdTxHMSzBjh6QEJ5Gx73RneuJ SrMA== 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=Jp24jlc9Bg31AZmz4unD39qMa3My4YzwOD1gWREHhIzr7oHNBvDCIe84eYoHWgdaSh aSgwOoD9/H6D9gST+Q0SCox3c/VOA8nYFzVby/JVRTvA5ivXU+eLTEqc7GBH+9LNWBO3 h5m3l5SRSnJvZ64TLCYhTOZ8uLZYusygvnYIjD7B/dcaelsma/UG46X77jZNs3ou/pbM XX8ezD0x6/X/Hzm6uo6HYChz1DkByt2gXrntLW/DsT2kv+1JtYCvlXb8/6tSgPqyWwb7 ec43ooY9iMDLZw+qOAlLL4DPVAbkQpGBrA0uoVjgybYKTCYImMdBZzGyTGNF8piEfpbC u3iw== 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-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-pm-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 y13si5540256edv.220.2021.02.28.22.53.27; Sun, 28 Feb 2021 22:53:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-pm-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-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-pm-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 S232156AbhCAGwJ (ORCPT + 7 others); Mon, 1 Mar 2021 01:52:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232146AbhCAGwE (ORCPT ); Mon, 1 Mar 2021 01:52:04 -0500 Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 607E1C061786 for ; Sun, 28 Feb 2021 22:51:24 -0800 (PST) Received: by mail-pj1-x1036.google.com with SMTP id s23so11092729pji.1 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=HUU3UCFa4tdDS610oSlSXTCh4TJaVrSR4uahzl41xZIsgghdwijfJuoARYcY02Xq8u vj4U4vh0Eb6JUFI605rRQWSZWgmPJ+SEV9bW31oz2rnyaZrFdM9s+4FP/HmWTpzRZHzb HtJ2lcfWggHdTkq/9cbTNEQhlGxQgz4JJLbXJ0Hvhh14ibhGLco9LKDpEFOmeiRpXsWb O0GU7rhfS1oBvZ3p3tH4KKUCvyoIbKVNuz2h3s/NPk0HW0Ck/nShWn8SZ3rqEUfxTFAB 9uSzkYLXFtrWmAbtzJquvKGeBY9ucdnoA9eefqA1x6Lt9qrVOt8ehDkyAhHPWEDn/jeN T9EQ== X-Gm-Message-State: AOAM533YPEPRnldC/uGshKUG1NkcD3Fj34VOVOj64FqqOWb/VAmBP7ax UH04zNKo0I5qtXszE7kIcqtNiQ== 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 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 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