Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3599653pxj; Mon, 21 Jun 2021 02:21:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJydIXMPGE5IHJcrM8FFU0moyoGOBzjjF3rT2iEaBSBHSFXzr4u9qPqDiLtws1NDTb416wMw X-Received: by 2002:a05:6402:152:: with SMTP id s18mr19824202edu.221.1624267288908; Mon, 21 Jun 2021 02:21:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624267288; cv=none; d=google.com; s=arc-20160816; b=GtfSLBLa0/vW3f/7rPkdJBQRwdittSxp/tQKIRXXIAuO3VFI/om7UEyI26GcjGo3/O tx5I2f0kh4osfn8PT/bEsqpRalF7iJwS0zYZjlDVM/pMLzEFy5jtQH149ph4eUXOlxcB L9nuxezqWU5+wSck2AgV2VBt4U1Fy4gMITsSOevOE87qUu6ZeY6RyyQ4OV6Xdeyvj0/3 zKii5t+uASkxX2+fKqunlHB6EDAl9XK2TOtaAg1wnF21OGLW+KIPn9C3qmXWKjrZ7D7V 20BJr808D0lQKYcoG8nAShT3jR9RRZ2ihZqsCshAtopO6JaUEzzkIgUYHVA2BjzJIEhC Rxpw== 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=xucopJdQYEMHhZQ7dqqB8UQAFZOXBMVYsdXdizA97FA=; b=GPDeFgf1gf9QlH8Zo7eMZJY2r/M0olqOYiiky2L1NbyuE/21q/XFJZztwkBoLY/KeF ijknvWrU9k1RaVELcyTGbxXAA0yh1AN+BY0grzK6abuQafS1L4FHeRUTLCO15r3GRZ/0 fYJVKE3fFa1Wcr80Q7EOtrMa5xGCp5r3U9qu75sGXIuiA8ZDPWUanVKMbhV1oR8EJB7Q jLPeJ8SQqQRrEMWqv14htmvqItmVvoL2rth6rd0AuDOSZfSU9qJcJZ/LXOJyTUxZas3o 6X/KAjp1lnEHbL2nKjwfTmub1Z6vgRxykWOu2gL1t4ifCkpaazeITPHXV7V9yac1Log0 0mrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vgHziPNR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 h12si1440620ejx.90.2021.06.21.02.21.06; Mon, 21 Jun 2021 02:21:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=vgHziPNR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 S230232AbhFUJW2 (ORCPT + 99 others); Mon, 21 Jun 2021 05:22:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44514 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230102AbhFUJW1 (ORCPT ); Mon, 21 Jun 2021 05:22:27 -0400 Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 075AFC06175F for ; Mon, 21 Jun 2021 02:20:13 -0700 (PDT) Received: by mail-pj1-x1029.google.com with SMTP id o10-20020a17090aac0ab029016e92770073so9885072pjq.5 for ; Mon, 21 Jun 2021 02:20:12 -0700 (PDT) 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=xucopJdQYEMHhZQ7dqqB8UQAFZOXBMVYsdXdizA97FA=; b=vgHziPNRBMyZcOclBhC3U0MKPvE9Hn1g1zorbrtQPSjbwjjMHtxuehLkK5jav4xtQP 0MsgvldXgiQbvefMiSDkhR0TiOaOfA3sw7mIbn4hm//b6lkh2TSQ/YwZbqiwf9k6q/yl MpAFGvVHz6gQ8nfIE6QxXJhawJXd93wnismO4+HeCAIO4326OoyrTnZPgapwS53dgSOD 2mJPLOYkN9tz8rtAKlyp/n7wxonyxaqipTjoEzSm04OT0zO3uTSx3e8XZY026j5NTswn 9c2xHcwYqnPU4NA+I6izG4vBuEs9oAjRCzer7DlyPRnQZtSsiugwN/QrvqdekmRETZ34 n7rA== 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=xucopJdQYEMHhZQ7dqqB8UQAFZOXBMVYsdXdizA97FA=; b=lzS9ZbNvgjSGZ0fY9Kl5sCAadEpPkjxA8shXNBHNBfNlsjvEBvvkWXb19GUs7IV7iI d3WB8i0FSB9aCMh6x/9hbLvODdihNJpOa6DpJ42TOx7FcqFA6Lvq/jeD4P38rB6jb6U0 J3ZoXg9RLi+qTgLoye76/7DLG7/+gkKFmToiUa8CIcGAfbtscgxE+L8AazfbiyicJk88 qYJps6w09uYrEjbiGudoGljeR/qRYCdKB+2HYwtipm9tVSqNSz732vtT3S/BTyqTFynf BA24ZnRHI0g/P+XguDJ9jHYYrglii7721SiDzFHdRZeATA+uycZv8V4x+etXeKXOJE3/ KBkw== X-Gm-Message-State: AOAM531+K6tXyc1mOxBt+fk/XBBISlzInNwy3iYG9Z2y/9ZtnY5DIi/J /3YOiDA/uwXjwbbKtGudZ+5QbA== X-Received: by 2002:a17:902:e313:b029:125:827f:c621 with SMTP id q19-20020a170902e313b0290125827fc621mr1847055plc.25.1624267212333; Mon, 21 Jun 2021 02:20:12 -0700 (PDT) Received: from localhost ([136.185.134.182]) by smtp.gmail.com with ESMTPSA id w123sm7828850pff.186.2021.06.21.02.20.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Jun 2021 02:20:11 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , Ionela Voinescu , Ben Segall , 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, Qian Cai , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, "Paul E. McKenney" , "Rafael J. Wysocki" Subject: [PATCH V3 0/4] cpufreq: cppc: Add support for frequency invariance Date: Mon, 21 Jun 2021 14:49:33 +0530 Message-Id: X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, Changes since V2: - We don't need start_cpu() and stop_cpu() callbacks anymore, we can make it work using policy ->init() and exit() alone. - Two new cleanup patches 1/4 and 2/4. - Improved commit log of 3/4. - Dropped WARN_ON(local_freq_scale > 1024), since this can occur on counter's overlap (seen with Vincent's setup). - Handle stuff from init/exit() callbacks only. Changes since V1: - Few of the patches migrating users to ->exit() callback are posted separately. - The CPPC patch was completely reverted and so the support for FIE is again added here from scratch. - The start_cpu() and stop_cpu() interface is reworked a little so stop_cpu() is only ever called for a CPU if start_cpu() was called for it earlier. - A new patch to implement RCU locking in arch_topology core to avoid some races. - Some cleanup and very clear/separate paths for FIE in cppc driver now. -------------------------8<------------------------- 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 was reverted earlier for the 5.13 kernel after Qian Cai reported kernel oops during suspend/resume. This is based of v5.13-rc7 + a cleanup patchset: https://lore.kernel.org/linux-pm/cover.1623825358.git.viresh.kumar@linaro.org/ All the patches are pushed here together for people to run. https://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm.git/log/?h=cpufreq/cppc This is tested on my Hikey platform (without the actual read/write to performance counters), with this script for over an hour: while true; do for i in `seq 1 7`; do echo 0 > /sys/devices/system/cpu/cpu$i/online; done; for i in `seq 1 7`; do echo 1 > /sys/devices/system/cpu/cpu$i/online; done; done The same is done by Vincent on ThunderX2 and no issues were seen. I would like to get this merged for 5.14, since it was recently reverted from 5.13. And that it is still an independent change to a single driver and topology APIs that no one is using apart from arm64 topology stuff. Thanks. -- Viresh Viresh Kumar (4): cpufreq: cppc: Fix potential memleak in cppc_cpufreq_cpu_init cpufreq: cppc: Pass structure instance by reference arch_topology: Avoid use-after-free for scale_freq_data cpufreq: CPPC: Add support for frequency invariance drivers/base/arch_topology.c | 27 +++- drivers/cpufreq/Kconfig.arm | 10 ++ drivers/cpufreq/cppc_cpufreq.c | 287 +++++++++++++++++++++++++++++---- include/linux/arch_topology.h | 1 + kernel/sched/core.c | 1 + 5 files changed, 292 insertions(+), 34 deletions(-) -- 2.31.1.272.g89b43f80a514