From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.214.182 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796286510; b=0denAwKn0Ats+eWckNvIWjPuK9A5RhjFYTckG9u2svc5EY+MIfa/zl+YqIHWCWPy0tKS H1YSKUsUfqwDoYC+27O/e47OmdW04bCXgOj2Hd4oqneNYvGw8d9Y+vNU9D+TKHnjlswui 39TpyXm5SId7zNTG4rf2MogKkvHymcpApIWaFVyHHrp8ELxkggc86ucDlQuSgfOxu1Jep DalNIHoorZLpULrRvt0O2x3u5JQoxBCGUPNbbVEfUE8cL19ENLmfN6lV3qmheM6zmntuj brKp7HV0+Er1Qqbn2h3vA6SqTksiEtz5al0CGBeGIiXe786P2CBK5GEKp7cCQAnlhiA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796286510; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding; bh=kthOAyosrFq0+Fl06PA0UfdiJvbfsjfQoD2PcQxjsCY=; b=vdQ42mbD0GoQjHYV/r95ecjixsVnpa2jF+sKRKGzPUeotgZoAYIWl0Ej96iP7C1YBWiJ VyuV/O69TJYT9+omSi45Cf9avNPqRQrbQnBV8Yw8/Kvz/qQLVgS/I4TRbuj8pNwme8gW3 N449k/briH/lILHBBq+S1/VijDiTbBM8H6vXs0Q5pSlvCiLUsdcTriEq18K/2rRovwwrP Vl0i1H2Ybj2QOMqne8t57PKWjhSuqGqeTu5P7qRrUPLwFVVVS7OeqD5mwSBMZ6Eh8Txwm o44i9MKz0+6Ej7QuZbKdslnngLMhScSwsZgAsT7RyPVIApG3r1MlsgAsqakwjGflpCA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b="WXZB4/yG"; arc=none smtp.remote-ip=209.85.214.182 Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E7F42606A695 for ; Thu, 3 Dec 2026 08:28:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org E7F42606A695 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=WXZB4/yG Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-2f020d0169eso70446585ad.0 for ; Thu, 03 Dec 2026 00:28:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796286509; x=1796891309; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=kthOAyosrFq0+Fl06PA0UfdiJvbfsjfQoD2PcQxjsCY=; b=WXZB4/yGSGAudL4KS+vVZD26Kw/a/XlcMtNtuR0EzalhTvXuiZQazSJ0WeTKEWTmJW RWLoUKWmE3u4pPVyOIix5duWRag4LXZ63n/F5v0supLLRbRYySPLBOf7X9uF6sXBlT+F 7qMwxTrsWdjLLOyCiTHq0q9luptsHzWzUg54AJy/QOnzq468zbUlaLxumD1vyCa4s36c LZWmkm4fEOxp8E90JmAURMTuhbCf9NDDj7LIgQaRUfVuZZ0qLG8BrlEpUnqzncFwT84e Qs74NJy2xlROCDsyKJguO4xqT6ujq4my9RCk/pUmcLWXNH55/JFrVaVX0r09/kEDawLN MhZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796286509; x=1796891309; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=kthOAyosrFq0+Fl06PA0UfdiJvbfsjfQoD2PcQxjsCY=; b=2P0lQfNkdsg3VPeLk2XPyXPGtrVfmAB2Hsw/Hjp7ODqrQndTWpHdAhqn0wGok83Plq XpbdSCTna/9yGTXhpuWz3iQBFfS+0OuHjsEqo3g1dzq+/slLQet0aB0GTAqwNw5INbsV HS6YYJ7MDmy0t2Wc571Z83FZcOxvlVBZ9JxtqYn9fw852nFnST8Ks8pv1CDX2Imvasil moJWDU0Snbpzbp3kOIsVE3jqnNv3KEcXXMCaesJkqMeKWpsElAYD6vhF9gasw/7qPCJY sWE/lwbXA7eNDRsEgnt9azvd45mxiHCjBoiAXdicRcf26Jl3rhpnqrH2HPt9nxZIRVeB 3YLg== X-Forwarded-Encrypted: i=1; AL+hErG5z8ERAMAhPC25kV4j7L4X8QbaJrpUb7ZpjGFSyOtQvbJ9d+JrO4ttLOC2UQflxjMM57cVDP801FOcDkM=@vger.kernel.org X-Gm-Message-State: APuU4Z+KcYuvJEcyu0JURZ0MKGscpFzBfETRQ+UIqvos/6M6oglFpCzk EUrqiriMHsYyjwPTxg4Anp+ccc1iZq60lFlVxXuIZupHSsVN9QNBOL6w X-Gm-Gg: AZFdTZeUjFNr5LdKpSYa7wq9qon735vzDjgJTSpceHY+6r2zZl7f3Cv6VttYjOLgPCA Q1jdYTPE/3njh8X8FgRdy9gFVKkSh/JyESr9Zir6yLgUdxPOUOopSrwpaARVpuSlduAfmFjqrhy dlIo2eI3emV48sTNn5w37bXWnzaX0iyvQFLfgxYhmGbUKxedN7HF9xw/j39D5GUS38weiVqZZzg pppNR9KI0YOC4lEx06FONFlvw8Ds+pM4jmjud9vA8kA94qDQjpmAS323mvFYTQMdEGflagr28t/ LpJcTLsoZJv90a6t/ZZtg0q2Gzw1KHuDa9Hn87PmKw7CV8hLG0VDU3BvnNQZ1gLxtC+zHCzlCnl Yxq6WphkeXsam0CV+SUR0DLVREyFQ4OvJQ/PIYxpH2bO5CPg2khxLF/nHCI5vIakXpWh00IIg1K BwdnZ9fB+orKdwVwD7mk73N4cy8goq2ZK3Z3sKBu6eAs1uSUphKCbqLGjAkIzC8emoeAnQr91F7 8So3n6QCZbH7ZQVm/PEM2LJxjBzsvmotEPFDkH5iQmnQCNZcNQJfIT+JzgvocNYolHD96anEGKr f4kVU9pnIyxx4/FHUWdVrHI8NMn/6WyoZ6QN9UsOrq2LyR8XIBVVUrkOruPSUQ7W5PsND8pywUH SBuHpcjk= X-Received: by 2002:a17:903:41cc:b0:2e9:5c55:c46a with SMTP id d9443c01a7336-2f03ef594e4mr412773525ad.7.1796286509062; Thu, 03 Dec 2026 00:28:29 -0800 (PST) Received: from mi-HP-ProDesk-680-G6-PCI-Microtower-PC.mioffice.cn ([43.224.245.226]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2f03f105b76sm217690715ad.50.2026.12.03.00.28.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Dec 2026 00:28:28 -0800 (PST) From: "zhidao su (Xiaomi)" To: qyousef@layalina.io Cc: dietmar.eggemann@arm.com, jstultz@google.com, juri.lelli@redhat.com, linux-kernel@vger.kernel.org, mingo@kernel.org, peterz@infradead.org, rafael@kernel.org, rostedt@goodmis.org, tglx@kernel.org, tim.c.chen@linux.intel.com, vincent.guittot@linaro.org, viresh.kumar@linaro.org, yu.c.chen@intel.com, zhidao su Subject: Re: [PATCH v3 04/10] sched/fair: Remove magic hardcoded margin in fits_capacity() Date: Thu, 3 Dec 2026 16:28:21 +0800 Message-ID: <20261203082821.569525-1-soolaugust@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20261126051429.14091-5-qyousef@layalina.io> References: <20261126051429.14091-5-qyousef@layalina.io> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Hi Qais, On Thu, Nov 26, 2026 at 05:14:23AM +0000, Qais Yousef wrote: > To calculate this threshold, we use the new approximate_util_avg() > function to find out the threshold, based on arch_scale_cpu_capacity() > the task will be misfit if it continues to run for a TICK_USEC which is > our worst case scenario for when misfit migration will kick in. Using arch_scale_cpu_capacity() for the threshold is clear. What I don't follow is what happens to capacity pressure. > - unsigned long capacity = capacity_of(cpu); > ... > - fits = fits_capacity(util, capacity); > + fits = fits_capacity(util, cpu); capacity_of() took thermal and rt/dl/irq pressure out of the real-util comparison. Now a throttled CPU and an idle one report the same threshold, and a task whose util sits between the two fits where it did not before. The comment below still says the opposite: > /* > * We must use arch_scale_cpu_capacity() for comparing against uclamp_min and > * uclamp_max. We only care about capacity pressure (by using > * capacity_of()) for comparing against the real util. Pressure is now honoured only on the uclamp_min path, through get_actual_cpu_capacity(). Was dropping it from the real-util path intentional? If so, the comment needs to change in this patch too. Thanks, Zhidao