Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp5534421rwb; Tue, 22 Nov 2022 01:05:10 -0800 (PST) X-Google-Smtp-Source: AA0mqf4L6mBVEQO1AzwTki8t2vdzCoWB8LmUOFktpkiW3QEGhha9CzsO8ghg4hx+CTSMAZoT/q/O X-Received: by 2002:aa7:cb4d:0:b0:469:e00a:a297 with SMTP id w13-20020aa7cb4d000000b00469e00aa297mr2587148edt.333.1669107910570; Tue, 22 Nov 2022 01:05:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669107910; cv=none; d=google.com; s=arc-20160816; b=YhHEyh5DoKX/ywd0v0dd3jIEmCwYjPuTl37P6dkuGNuee8Xr5miIaiYD+PA+Ybga/2 HCav8tTsgmSssxAZHV4P07YjY8arZZetxhYf3P5Q+bgYcXtQpksimBN8f8akFJIv6gWa vJ3XpchgCNlWtYfHJpjvGfwkLnYx1ft5hDy+yXp0wzeYP5C32xNaYazXFAp65Y/X++xZ KIEw49seK3I2yFypAUtLCaoeeMgRomMHlmR5c3KIl0hqsvyNIbBW6fHJGJx/eZhm3Gy8 DxYxQ60O9TJjQNJXLBKkBMI1oN1ycHFL2ZMwhxhi6i7NeORkqQ3XC23nXUPm1+6WcFL0 +NUg== 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=S6/zvDsdKyAK5iwEp1qPkDdVtPV+cRqUIiW5E1/B9kM=; b=iT2zFDskWxmlaUrYKTE2CsSdsaLH3AkmPFLDyrypcX0gDUA3edQuwwXO/mKTUDqcFU EfLXtytNAhDkX9nUx0NZsUr69bFrUImcTtdzSGHt+HIdvsFOnqYh6L5XSMA6HebbT+u/ ZyTsWovTzuw4uQus4fvghNixJ9pyJkI/Q/QzWwytymN8BWaYKWzwLelFVoaQ9VwaBDeH 3AQqI75BXiwIBL9UQXVsO79gAeU1Ear8NzNLT+rDjT01BwwCLNDCSkiWQnR0p8HFPxNb cuLbbN5sFbkHAux94S2kASq3vLUjnLcSgAyee1mEI5ZdmqqcEKYu1NRYX5Hgmo+wWG5g KSWQ== 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 f13-20020a056402354d00b0046125ddf5easi7390377edd.185.2022.11.22.01.04.44; Tue, 22 Nov 2022 01:05:10 -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 S233150AbiKVI7V (ORCPT + 91 others); Tue, 22 Nov 2022 03:59:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59126 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233089AbiKVI6x (ORCPT ); Tue, 22 Nov 2022 03:58:53 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C5847193F2; Tue, 22 Nov 2022 00:58:18 -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 920E31FB; Tue, 22 Nov 2022 00:58:24 -0800 (PST) Received: from [10.57.5.144] (unknown [10.57.5.144]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id DBA103F587; Tue, 22 Nov 2022 00:58:14 -0800 (PST) Message-ID: <97af1300-541d-a79c-404c-92886f10b220@arm.com> Date: Tue, 22 Nov 2022 08:58:12 +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: "Rafael J. Wysocki" , Sam Wu Cc: Saravana Kannan , Viresh Kumar , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , 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> 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.2 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 Hi Rafael and Sam On 11/21/22 19:18, Rafael J. Wysocki wrote: > On Fri, Nov 18, 2022 at 2:00 AM Sam Wu wrote: >> >> On Wed, Nov 16, 2022 at 3:35 AM Lukasz Luba wrote: >>> Which mainline kernel version you use in pixel6? >> I am using kernel version 6.1-rc5. >>> >>> Could you elaborate a bit how is it possible? >>> Do you have the sg_policy setup properly (and at right time)? >>> Do you have the cpu capacity from arch_scale_cpu_capacity() >>> set correctly and at the right time during this cpufreq >>> governor setup? >>> >>> IIRC in Android there is a different code for setting up the >>> cpufreq sched governor clones. In mainline we don't have to do >>> those tricks, so this might be the main difference. >> This behavior is seen on the mainline kernel. There isn't any vendor code >> modifying the behavior, and the schedutil governor is being used. >>> >>> Could you trace the value that is read from >>> arch_scale_cpu_capacity() and share it with us? >>> I suspect this value changes in time in your kernel. >> There's an additional CPU capacity normalization step during >> init_cpu_capacity_callback() that does not happen until all the CPUs come >> online. However, the sugov_start() function can be called for a subset of >> CPUs before all the CPUs are brought up and before the normalization of >> the CPU capacity values, so there could be a stale value stored >> in sugov_policy.max field. > > OK, the revert has been applied as 6.1-rc material, thanks! I was on a business trip last week so couldn't check this. Now I'm back and I've checked the booting sequence. Yes, there is some race condition and the mechanism using blocking_notifier_call_chain() in the cpufreq_online() doesn't help while we are registering that schedutil new policy. I will have to go through those mechanisms and check them. I agree, for now the best option is to revert the patch. My apologies for introducing this issues. Thanks Sam for capturing it. Regards, Lukasz