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: 385751 Delivered-To: patch@linaro.org Received: by 2002:a02:290e:0:0:0:0:0 with SMTP id p14csp1180032jap; Mon, 22 Feb 2021 03:19:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJwO80wlEp8SbCIdd36edNxOiGw0Ia7o/FWIVUQCJxN8wUFPyMGGwWYeyqHG1jtAxsZOCqP/ X-Received: by 2002:a17:907:a059:: with SMTP id gz25mr20534992ejc.400.1613992757615; Mon, 22 Feb 2021 03:19:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613992757; cv=none; d=google.com; s=arc-20160816; b=m/OthqRmAeDSHiKk/2zqibWAhv2D1xShhalptEa9WKq6B+mhzxaC0Zh4C/RtPkb009 hy5gLqQFr9r/gDmUksl488gPPhcguNygAxMhFvc3R/1i2cF31ZLBT9bv0jG5KFgN5UEc QMop9rCoiRroX1vyZ5VBUIixB8UJiOlEyFo0LeBuMTdGxvbbkn5ahCkeSynKdHh2Epge 3ZpRoyxhoV7Hfu5MAmW4d1NioRJ9v5bzh1qqnfVIASLW5MEBM9s3jsw4BJAtYdlyTBd4 GdCF6MGv3KuBWb0s/TiDZ4uxKt8ol6V9D2GmE3lI/jUStFDmp7qvTgRhFa0J56FAuEbN 78zA== 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=rT96flgGp5OXr1BQHnPn+JClqj+1qV978OMJSYTUtHQ=; b=AnJ71k0UKp2EcA9/DYmLG2INlHrGFR0CUh0DJvPvVGiUWaD3WVsUbzTBCac+UMirnH jJsP94rY7LnLtBP6ZxWTwhVsGuW2lEvODZQ6EuDuVVpXDBcb4kpA3ufBYtReViccuVCW OU0Zw2HaNEfilFoME3Bds+ifxn4UN6AneSzen8FIN0J3jj7rTXRw0iSxcJ7JIBKlYqKJ FPHqGAMw6hcTV3ZtT7/mbjwQIsn/H+LuOFGpY5jikLIw0PY6EtB/ANZd1HK+0NXmTScM AwSN6O2de8RZVh3nDJDnrkL3c5EIykEpqbcJuCwR0W8P/OmxQpo80dnQIxA7FZIcmOna bv4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=r+pugnSl; 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 t29si9136793edt.211.2021.02.22.03.19.17; Mon, 22 Feb 2021 03:19:17 -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=r+pugnSl; 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 S230077AbhBVLTQ (ORCPT + 7 others); Mon, 22 Feb 2021 06:19:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46240 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229995AbhBVLTO (ORCPT ); Mon, 22 Feb 2021 06:19:14 -0500 Received: from mail-pl1-x631.google.com (mail-pl1-x631.google.com [IPv6:2607:f8b0:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 72AFCC061574 for ; Mon, 22 Feb 2021 03:18:34 -0800 (PST) Received: by mail-pl1-x631.google.com with SMTP id ba1so7544235plb.1 for ; Mon, 22 Feb 2021 03:18:34 -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=fbCUV0Ga3HKN6KG2rhLnot0doYYUmadUzDqPf9K+846STl/WIqEP/w6XMAZVvQzRlJ WmXyoFmukVI3t14fNNmIZQKSFmMaOoLQqgGd/vHOZcHBJ+V/3QySO470h7CgWUMoERxM d5NQQVcB/vrOtDhf7UiXEwNr8qzV82X5YHFp04GAoL3UIAbevaN2hv0tzYX5Kqea15DM jJvmduKpMy0RAaA1fijtLyAGMSZQ17cS7ki1uO+hPeQWZuci10ZR9AIonaqUaGIxcB9j dtTZkGHUs5MewYq9oPvADXrMFJRROSUm+RcNvLROP27W7+HJMf4Y6mSxBRGZhEBzPNGk xO5g== X-Gm-Message-State: AOAM5315KlkqBqKUeCYWOkzq7aQhBlTIow5Hssxnn/xbnca3t9q+crck ocXsurHLjZlAZqKEqkGIJvEt7g== 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 Cc: linux-pm@vger.kernel.org, Ionela Voinescu , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org 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 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 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(-) -- 2.25.0.rc1.19.g042ed3e048af