Received: by 2002:a05:7412:8d11:b0:fa:4934:9f with SMTP id bj17csp549054rdb; Mon, 15 Jan 2024 06:03:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IFCY7JQ7EWVpmPg8JHy4n1CEizKDOiA5MCYa6sY9Qc4BdRlpgEUKNBiGccPTV1Gq2g5VodD X-Received: by 2002:a2e:8006:0:b0:2cd:1c12:cb16 with SMTP id j6-20020a2e8006000000b002cd1c12cb16mr2239861ljg.81.1705327424623; Mon, 15 Jan 2024 06:03:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705327424; cv=none; d=google.com; s=arc-20160816; b=RXW4Tr9q0YP8tl5IL64S37oLEC8YeVqKZ35xJ23NjOn+uKwnDtaDYeGHAxwzfkPT3b gQ26XcagQZq8aCXcZ1VFNej78ROsNUp2bDFfDNgPXxujegilsPKH/RVzOcYE0stHIewj Ey8ZzjV7SCIT/38+DKeiex8y+TCwCoduIbmYCqr5cunxyH/UFDAfCfF645xufitck/Rf sg0oCDA9m7LS5CXgMp1i606TUv8l2K3glq4pQrU2Pf2hb7v3h5TmqfW5gH/MkL27U0n9 cpu3Rl3CMkQENDvnIpMm3St/9ECDqq8dqP2cmCauErjSQiqxkv9I2F8JTyn68ZYEoZK0 B26A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=nIKJ6JyA0CiiUbcD1PHpZI7yLatAolWk4k6aEXNfdi0=; fh=pde6kNiKaw/yCRE83mnRhJATNl5P9eywQ5KqfGNXIIY=; b=C2MPzyXVVTmXiTzqsbK9+ZcGgL2a0BixXRrhsrZ1ogol4CSkRwjTKoMQm0i6yTlkyb MC4B1D1aamCJ43qyOwRiIN1hy133EQyflf7xfhTSPlwq5wzqBrWJKbfndB6aycw/KbRG Mk+gZrrwsTSnjZQ4dphukk7BbTBRQMMeg8JJGPQb2VqbE9RWocsReLQG+ejniVSOmzdz hawEwpicXmtTyssnDP2ob3fwKvhkSPgpO3jjJ+ZdZxN4XXwct1/QxWr6uGgEZpBIehDH /uPpeeNGxoocfdYwicJyVbditZS6z7DL8o3qeIeT1kgIIjSMXK1f+uOHoB+Ei7sa4028 1fnQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-26070-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-26070-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id z22-20020a056402275600b005582e993832si4033428edd.294.2024.01.15.06.03.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jan 2024 06:03:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-26070-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-26070-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-26070-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 5C5751F221F4 for ; Mon, 15 Jan 2024 14:03:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 251E81758A; Mon, 15 Jan 2024 14:03:38 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6908917583 for ; Mon, 15 Jan 2024 14:03:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com 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 EC3A62F4; Mon, 15 Jan 2024 06:04:14 -0800 (PST) Received: from [192.168.178.6] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B13383F6C4; Mon, 15 Jan 2024 06:03:25 -0800 (PST) Message-ID: Date: Mon, 15 Jan 2024 15:03:18 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [GIT PULL] Scheduler changes for v6.8 Content-Language: en-US To: Vincent Guittot , Qais Yousef Cc: Wyes Karny , Linus Torvalds , Ingo Molnar , linux-kernel@vger.kernel.org, Peter Zijlstra , Thomas Gleixner , Juri Lelli , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider References: <20240114091240.xzdvqk75ifgfj5yx@wyes-pc> <20240114123759.pjs7ctexcpc6pshl@wyes-pc> <20240114151250.5wfexq44o3mdm3nh@airbuntu> <20240114195815.nes4bn53tc25djbh@airbuntu> <20240115120915.fukpcdumntdsllwi@airbuntu> From: Dietmar Eggemann In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 15/01/2024 14:26, Vincent Guittot wrote: > On Mon, 15 Jan 2024 at 13:09, Qais Yousef wrote: >> >> On 01/15/24 09:21, Vincent Guittot wrote: >> >>>> Or I've done the math wrong :-) But the two don't behave the same for the same >>>> kernel with and without CPPC. >>> >>> They will never behave the same because they can't >>> - with invariance, the utilization is the utilization at max capacity >>> so we can easily jump several OPP to go directly to the right one >>> - without invariance, the utilization is the utilization at current >>> OPP so we can only jump to a limited number of OPP >> >> I am probably missing some subtlty, but the behavior looks more sensible to >> me when we divide by current capacity instead of max one. >> >> It seems what you're saying is that the capacity range for each OPP is 0-1024. > > Yes that's the case when you don't have frequency invariance > >> And that's when we know that we saturated the current capacity level we decide >> to move on. > > yes > >> >> As I am trying to remove the hardcoded headroom values I am wary of another >> one. But it seems this is bandaid scenario anyway; so maybe I shouldn't worry >> too much about it. I still don't fully understand this fix. We had: sugov_update_single_freq() sugov_update_single_common() next_f = get_next_freq() freq = arch_scale_freq_invariant() ? policy->cpuinfo.max_freq : policy->cur (**) <- (2) !freq_inv util = map_util_perf(util); <- (1) util *= 1.25 freq = map_util_freq(util, freq, max); <- (3) } And now there is: sugov_update_single_freq() sugov_update_single_common() sugov_get_util() sg_cpu->util = sugov_effective_cpu_perf() /* Add dvfs headroom to actual utilization */ actual = map_util_perf(actual) <- (1) util *= 1.25 next_f = get_next_freq() freq = get_capacity_ref_freq() return policy->cur (*) <- (2) !freq_inv freq = map_util_freq(util, freq, max) <- (3) Still not clear to me why we need this extra 'policy->cur *= 1.25' here (*) and not here (**)