Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2521355rwb; Wed, 30 Nov 2022 07:36:53 -0800 (PST) X-Google-Smtp-Source: AA0mqf4PUm/JxSCvM8gUwN95Z82qsmoWPhXdQrE6/W2cCkJ81TEtyf3Mud3LDHEPZZlUgybokH6W X-Received: by 2002:a05:6402:2213:b0:46b:1d60:f60a with SMTP id cq19-20020a056402221300b0046b1d60f60amr14794451edb.193.1669822613526; Wed, 30 Nov 2022 07:36:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669822613; cv=none; d=google.com; s=arc-20160816; b=s5wqo56z8tFH1ekX4djVZ1Yxu8SBtW7aHR2F8+yt8vUljE1d5e43P7uodmIx/WypuE hZuSnbOCCH1fmMYKvgDWIaAKHq3QzWOi2BuTt1w+OmkdM1he+favkHpz6nKhA5LX8dQf qLRVgkPIkLjrWIOZwkf7QvXfVB2fKfs2JE5yYPm9m7+edhrfCVCwg2zn6TlJMbNNRkGH O7fjODVRbSAkXJX5Vz6c3XAKKFiKCKS8HWq/l/fFOBvqINEJwVSPjZ2OYNKo+eigq8Ds zdWu9a+DLlomL8zmMFA/GWPrtOSmqHKZceCd4bpiAIr9nGBHjmzgpUrnLy6W9ZNyNheP JjKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=pJn4ZWoIi5XQ2KfKGXmZ56HIGAic11N4uwEhr6Z42Lc=; b=oEjS4F+BgxVFNfr5GpSJiwtMyYbx3UPbYqWMIT8Zi2r5R5MP1jGLxKZC7Z9EUgBrz0 gLXsmdzH6QdVav5v6CFbPcjPmuOs3HvffXcHGOprC7aJalmdRhVOj5kYetvLsjbCe3mf RVVK+zg2iN7RhKqpw2oJBP59RpuCUuTfbdT7cghOGWSuCJjnhVQk5gr5LMfmRutEotVz Lp6vvrVU7x7kwcrUadMsNmXnkWm8+mYfDIY0PxkxKG7bAfAD/w7BzjD+ConBanCn7gFt Zq+YRXXGH/XRxhr7Fu5mz/SX9HWzp7mMNjCvYSCeKr4tWBciLozzXrp621DJDPC2zk2d vXYg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hq39-20020a1709073f2700b007c0969e429bsi1838828ejc.30.2022.11.30.07.36.32; Wed, 30 Nov 2022 07:36:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229694AbiK3PBB (ORCPT + 83 others); Wed, 30 Nov 2022 10:01:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229601AbiK3PBA (ORCPT ); Wed, 30 Nov 2022 10:01:00 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1989C72082; Wed, 30 Nov 2022 07:00:57 -0800 (PST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 67F59D6E; Wed, 30 Nov 2022 07:01:03 -0800 (PST) Received: from [10.57.6.100] (unknown [10.57.6.100]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 9A9133F73D; Wed, 30 Nov 2022 07:00:53 -0800 (PST) Message-ID: <3ad43913-00f2-49cb-ad3a-b0e12347389f@arm.com> Date: Wed, 30 Nov 2022 15:00:51 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: [PATCH v1] Revert "cpufreq: schedutil: Move max CPU capacity to sugov_policy" Content-Language: en-US To: Vincent Guittot Cc: "Rafael J. Wysocki" , Sam Wu , Saravana Kannan , Viresh Kumar , Ingo Molnar , Peter Zijlstra , Juri Lelli , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider , "Isaac J . Manjarres" , kernel-team@android.com, "Rafael J. Wysocki" , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org References: <20221110195732.1382314-1-wusamuel@google.com> <880b7332-562c-4934-4e92-493b112568c9@arm.com> <97af1300-541d-a79c-404c-92886f10b220@arm.com> <75bba88a-0516-a6a2-d4e6-8cedabadf413@arm.com> From: Lukasz Luba In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/30/22 14:29, Vincent Guittot wrote: > On Wed, 30 Nov 2022 at 15:04, Lukasz Luba wrote: >> >> Hi Vincent, >> >> On 11/30/22 10:42, Vincent Guittot wrote: >>> Hi All >>> >>> Just for the log and because it took me a while to figure out the root >>> cause of the problem: This patch also creates a regression for >>> snapdragon845 based systems and probably on any QC chipsets that use a >>> LUT to update the OPP table at boot. The behavior is the same as >>> described by Sam with a staled value in sugov_policy.max field. >> >> Thanks for sharing this info and apologies that you spent cycles >> on it. >> >> I have checked that whole setup code (capacity + cpufreq policy and >> governor). It looks like to have a proper capacity of CPUs, we need >> to wait till the last policy is created. It's due to the arch_topology.c >> mechanism which is only triggered after all CPUs' got the policy. >> Unfortunately, this leads to a chicken & egg situation for this >> schedutil setup of max capacity. >> >> I have experimented with this code, which triggers an update in >> the schedutil, when all CPUs got the policy and sugov gov >> (with trace_printk() to mach the output below) > > Your proposal below looks similar to what is done in arch_topology.c. Yes, even the name 'cpus_to_visit' looks similar ;) > arch_topology.c triggers a rebuild of sched_domain and removes its > cpufreq notifier cb once it has visited all CPUs, could it also > trigger an update of CPU's policy with cpufreq_update_policy() ? > > At this point you will be sure that the normalization has happened and > the max capacity will not change. True, they are done under that blocking notification chain, for the last policy init. This is before the last time we call the schedutil sugov_start with that last policy. That's why this code is able to see that properly normalized max capacity under the: trace_printk("schedutil the visit cpu mask is empty now\n"); > > I don't know if it's a global problem or only for systems using arch_topology > It would only be for those with arch_topology, so only our asymmetric systems AFAICS.