Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp658280rwb; Thu, 8 Dec 2022 00:58:15 -0800 (PST) X-Google-Smtp-Source: AA0mqf4LDh2U5/fCHGZ+tkLtg5lI+gEaVdesk2j0pEa7oG2xdoW2+tFxgEo29L9aBNWbptR9CxdA X-Received: by 2002:a05:6402:5307:b0:461:e3e1:bc3b with SMTP id eo7-20020a056402530700b00461e3e1bc3bmr69945983edb.145.1670489895096; Thu, 08 Dec 2022 00:58:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670489895; cv=none; d=google.com; s=arc-20160816; b=RCAU+CODqZMboSc8dkTujzeb4K7ng56/qgdrPY7ZfeOBfPTMb+ZkPRpxvNqv2znxAJ bAMJk8eVp+aP9iwTHrPbJRUk1bRBrZ5v5rVfKbQeW3lcviQi27OWfBgsIoq/+YAaHXdj NqOtYD/VPbyYeSDFWT4lMsQzLOnviDu0eAZLVprMUwyF1J9cpI6QMZkAYzOzZDTD62G1 pER1kNy0XELfn440a4mi9YVeUwoZPFphXEO3zzL/DKjIpIsm8+Y6AhdlLTUIVGeV6qsn YAHv8u1coQk93/joRuWJMA22dnS7GTQZED4Yo8/HhQKOHsTrJmd4wj7KRAF516VvMokP RFUQ== 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=kHSom8Wu7aHXw9Pj8Ntqk5oZFq7o1MYBOyGQ2oW/R7k=; b=PHC+gxLKxfw1C7bAqzessTHgRY1Zi8COzMxaJMOF96RpgRfkFkFDIFZHpOKFTbVkon wtIOlEu4+KSv+25oTm9HQT5mzwcQH/zX2Y4FMxrwQeTve2m4LsON/szZ1CwQp51D2FP4 HsQbCjQ9GXAZ8FE8faEWYjzg3s+E5nCT5XIk5PBMSe43rcGMVH+/zZ6RyERJFfgDcF37 kGmMmIHXY/CydnrEWYkLzylUyaIClVPdeKb1m+XhF5LSBQCMhtl8dRQIu1vU7/AFAdZw qqNgly43Ugbu3ihKWizVTuq1dzQUwfoZbCHIbnA8lzc8lgLECihyv2gnum+kBVGnHnd+ UghA== 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 gt13-20020a1709072d8d00b007b2a6aaff06si21946730ejc.50.2022.12.08.00.57.57; Thu, 08 Dec 2022 00:58:15 -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 S229911AbiLHInt (ORCPT + 72 others); Thu, 8 Dec 2022 03:43:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229956AbiLHIn3 (ORCPT ); Thu, 8 Dec 2022 03:43:29 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9C9C0663F4; Thu, 8 Dec 2022 00:43:25 -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 7A9F123A; Thu, 8 Dec 2022 00:43:31 -0800 (PST) Received: from [192.168.33.10] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 2B8FB3F73D; Thu, 8 Dec 2022 00:43:22 -0800 (PST) Message-ID: Date: Thu, 8 Dec 2022 08:43:16 +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 v2 2/2] cpufreq: schedutil: Optimize operations with single max CPU capacity Content-Language: en-US To: Viresh Kumar Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, rafael@kernel.org, dietmar.eggemann@arm.com, vincent.guittot@linaro.org, saravanak@google.com, wusamuel@google.com, isaacmanjarres@google.com, kernel-team@android.com, juri.lelli@redhat.com, peterz@infradead.org, mingo@redhat.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de References: <20221207101705.9460-1-lukasz.luba@arm.com> <20221207101705.9460-3-lukasz.luba@arm.com> <20221208040921.tgwegk7fvdm4nkiu@vireshk-i7> From: Lukasz Luba In-Reply-To: <20221208040921.tgwegk7fvdm4nkiu@vireshk-i7> 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 12/8/22 04:09, Viresh Kumar wrote: > On 07-12-22, 10:17, Lukasz Luba wrote: >> The max CPU capacity is the same for all CPUs sharing frequency domain >> and thus 'policy' object. There is a way to avoid heavy operations >> in a loop for each CPU by leveraging this knowledge. Thus, simplify >> the looping code in the sugov_next_freq_shared() and drop heavy >> multiplications. Instead, use simple max() to get the highest utilization >> from these CPUs. This is useful for platforms with many (4 or 6) little >> CPUs. >> >> The max CPU capacity must be fetched every time we are called, due to >> difficulties during the policy setup, where we are not able to get the >> normalized CPU capacity at the right time. >> >> The stored value in sugov_policy::max is also than used in >> sugov_iowait_apply() to calculate the right boost. Thus, that field is >> useful to have in that sugov_policy struct. >> >> Signed-off-by: Lukasz Luba >> --- >> kernel/sched/cpufreq_schedutil.c | 22 +++++++++++----------- >> 1 file changed, 11 insertions(+), 11 deletions(-) > > Looks okay to me. > > Acked-by: Viresh Kumar > Thank you Viresh! As Rafael said, it will wait after 6.2-rc1 is out. Regards, Lukasz