Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp313818pxj; Wed, 16 Jun 2021 03:04:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwZapTSFA4u3TA0rk7hB4X5QFSOzVm4IR81hHQJdNwFvDaK3RR0tWjSbR1qdlj7IICs1q1+ X-Received: by 2002:a5d:94ce:: with SMTP id y14mr3162207ior.67.1623837882313; Wed, 16 Jun 2021 03:04:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623837882; cv=none; d=google.com; s=arc-20160816; b=jYaNo13KsV7eXz/rgGn34rEDfImFz95r+a6CLq15JXQzGnAhWdUBoSB72xeiBs/aM1 a+zXoBEA1qsoCWdgGWeIZyo1IS1Xipo1iV+a10o3p03yEq0P37sfxYm0x80gfD/v2sP2 cdSOS8suyX1AyuC9wSpVhT+4lVFuBXZnUeIjazJ2j0KUSlVTQcWMqSdnZcAclWc/foZ4 wRzP5/2WAh2EB3gVTDB63yWbC7nhmQiweyDw4/e9jRi9PJojx95M4i+tqqi5J+1AD1w/ jLIQxXAGuyXJ7pGRV8VA3TcmLNDk9oJCCUlea6GpIvgpPpj3q8bQjLchEvwq5jv93uEF EgVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=/4RwAjXPtC218FslHiEhUYGCqGEWToA3TK5+6fZBZNA=; b=J3FURHA9Z8IgK97BbTmB0kbi8QOkME5buOZv0+7kSK/MbqhElnHkAb1OXSssS3JMzs mcXNoCdZFGyIoV9qefO5TATcI/lj1N9FjjyIqjAwGp3ik48Mnus7GTnibO7upANlXtBs 6+ff8XPHbnB2jpsuV9G18sAqJ6NZPqEW0be2JlJRXdKPn/JJJU2mq7y0K/1YpCEyyycm 1IQj/CQ4ex7+UJVbUWjPgXpZ+DIo4q4GmRgHgwv0U9A7GQP7Gly8L+nLzXh/SWm3+cA+ gRZqnSJYC9JtTRdqOhFYZG5dC8HAtwSIGyZ5PvuPySY7aaRogEMOfYXu8D3lzfuKRLny +plA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=W++LxgSc; 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 t16si1759778iom.8.2021.06.16.03.04.27; Wed, 16 Jun 2021 03:04:42 -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=W++LxgSc; 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 S232064AbhFPKFK (ORCPT + 99 others); Wed, 16 Jun 2021 06:05:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49048 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232345AbhFPKE5 (ORCPT ); Wed, 16 Jun 2021 06:04:57 -0400 Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C8ABC061767 for ; Wed, 16 Jun 2021 03:02:50 -0700 (PDT) Received: by mail-lf1-x12a.google.com with SMTP id m21so3312411lfg.13 for ; Wed, 16 Jun 2021 03:02:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=/4RwAjXPtC218FslHiEhUYGCqGEWToA3TK5+6fZBZNA=; b=W++LxgSclajmCz1OuVwxJUxeVJT7cnBxMNmegT+m+GtL1a9J+QwnCek7Wrmt9I5xVg niE41/CBGR0oZBqLdovyjpzPVSI5b0RVpb2ofDNdHJQZ/r4N7xhPTtI2lhbdbPN1TmyP 9G8lykpjuFl4zqYrSEwOtuc8L7tLkx4d/YeNTAEXeLi/p2Ldw+jP+KGeZRauthCkV7hq L1P4cvdGnrJDcjP4w3Cm+IKV4sDY/QZ44MRhlKIbHDts9bW7TM43Z3qGGT560hDmkmOC e8JcLVHzA/ymO30I74Kpns7R20UJOnEeaGWucvQxbQSYqUGEXbbdavchN+Om91HCGjqK /Dyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=/4RwAjXPtC218FslHiEhUYGCqGEWToA3TK5+6fZBZNA=; b=KXuwFVfQBXC/EGbzKCxFMTLmY/qn0wCQzZ7Tv2XJjLJKJK2Fz83pmdLlI6+n91myfA npFJBFCwFp+qAhoxNSWlmZsF6QR+EQ/26WdNFpOGgds03JpfNGnvKIs/PS1orQKnHWeF N6j0ntQ4LFfVcWE3mi3nroT9rFhxFG2u3SRIu/iZiSLGnst6AaItsodz8TVTkdb8h/FR FroBqYmNHHg4xZEhq1AO4gQig1adeBVdPgaytj7OmZkaPlC/BaQ8OrYcMRS8CwpN/2rT e9sTYRO7cHRCkKa2U43gRiAMwYyd0UiYGiMc9dpu/SbNupwOsbpbq9gQhEFvFDp/tZOv yOtw== X-Gm-Message-State: AOAM530Aa882asBd1q8uv95g3ojV6e6BljfJAkpqc23ERAaVNeaNDfbv vNC8Tt0SHdMcSdAQTWySJs2ZMkApXST88ype6zKu8A== X-Received: by 2002:a19:4810:: with SMTP id v16mr3052847lfa.254.1623837768679; Wed, 16 Jun 2021 03:02:48 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Vincent Guittot Date: Wed, 16 Jun 2021 12:02:37 +0200 Message-ID: Subject: Re: [PATCH V2 0/3] cpufreq: cppc: Add support for frequency invariance To: Viresh Kumar Cc: Rafael Wysocki , Ionela Voinescu , Ben Segall , Daniel Bristot de Oliveira , Dietmar Eggemann , Greg Kroah-Hartman , Ingo Molnar , Jonathan Corbet , Juri Lelli , Mel Gorman , Peter Zijlstra , "Rafael J. Wysocki" , Steven Rostedt , Sudeep Holla , "open list:THERMAL" , Qian Cai , ACPI Devel Maling List , Linux Doc Mailing List , linux-kernel , "Paul E. McKenney" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 16 Jun 2021 at 08:48, Viresh Kumar wrote: > > Hello, > > 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 pm/linux-next + 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 > > > Vincent will be giving this patchset a try on ThunderX2. I tested your branch and got the following while booting: [ 24.454543] zswap: loaded using pool lzo/zbud [ 24.454753] pstore: Using crash dump compression: deflate [ 24.454776] AppArmor: AppArmor sha1 policy hashing enabled [ 24.454784] ima: No TPM chip found, activating TPM-bypass! [ 24.454789] ima: Allocated hash algorithm: sha256 [ 24.454801] ima: No architecture policies found [ 24.455750] pcieport 0000:0f:00.0: Adding to iommu group 0 [ 24.893888] ------------[ cut here ]------------ [ 24.893891] WARNING: CPU: 95 PID: 1442 at drivers/cpufreq/cppc_cpufreq.c:123 cppc_scale_freq_workfn+0xc8/0xf8 [ 24.893901] Modules linked in: [ 24.893906] CPU: 95 PID: 1442 Comm: cppc_fie Not tainted 5.13.0-rc6+ #359 [ 24.893910] Hardware name: To be filled by O.E.M. Saber/Saber, BIOS 0ACKL026 03/19/2019 [ 24.893912] pstate: 20400009 (nzCv daif +PAN -UAO -TCO BTYPE=--) [ 24.893915] pc : cppc_scale_freq_workfn+0xc8/0xf8 [ 24.893918] lr : cppc_scale_freq_workfn+0x5c/0xf8 [ 24.893921] sp : ffff80003727bd90 [ 24.893922] x29: ffff80003727bd90 x28: 0000000000000000 x27: ffff800010ec2000 [ 24.893928] x26: ffff800010ec2000 x25: ffff8000107c3d90 x24: 0000000000000001 [ 24.893932] x23: ffff000816244880 x22: ffff8000113f9000 x21: ffff009f825a0a80 [ 24.893935] x20: ffff009efc394220 x19: ffff800011199000 x18: 000000000000001b [ 24.893939] x17: 0000000000000007 x16: 0000000000000001 x15: 00000000000000bf [ 24.893943] x14: 0000000000000016 x13: 000000000000029b x12: 0000000000000016 [ 24.893946] x11: 0000000000000000 x10: 0000000000000000 x9 : ffff009efc6958c0 [ 24.893950] x8 : ffff009efc394248 x7 : 0000000002bde780 x6 : 00000000ffffffff [ 24.893954] x5 : 00000000916e502a x4 : 00000000d9730e80 x3 : ffffffffffffffff [ 24.893958] x2 : 00000000001e8480 x1 : 00000000002625a0 x0 : 0000000000000401 [ 24.893962] Call trace: [ 24.893964] cppc_scale_freq_workfn+0xc8/0xf8 [ 24.893967] kthread_worker_fn+0x110/0x318 [ 24.893971] kthread+0xf4/0x120 [ 24.893973] ret_from_fork+0x10/0x18 [ 24.893977] ---[ end trace ea6dbaf832bce3e4 ]--- > > Meanwhile it is up for review. Ideally I would like to get this merged for 5.14, > but lets see how it goes. > > Thanks. > > -- > Viresh > > Viresh Kumar (3): > cpufreq: Add start_cpu() and stop_cpu() callbacks > arch_topology: Avoid use-after-free for scale_freq_data > cpufreq: CPPC: Add support for frequency invariance > > Documentation/cpu-freq/cpu-drivers.rst | 7 +- > drivers/base/arch_topology.c | 27 ++- > drivers/cpufreq/Kconfig.arm | 10 ++ > drivers/cpufreq/cppc_cpufreq.c | 232 +++++++++++++++++++++++-- > drivers/cpufreq/cpufreq.c | 19 +- > include/linux/arch_topology.h | 1 + > include/linux/cpufreq.h | 5 +- > kernel/sched/core.c | 1 + > 8 files changed, 272 insertions(+), 30 deletions(-) > > -- > 2.31.1.272.g89b43f80a514 >