From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B54643242B9 for ; Tue, 2 Dec 2025 15:57:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764691039; cv=none; b=lmuewBX3kkHs+2YSCpnLAqJMpX5q1FVQjFx9uucQvXtD/0VpWOy4MwIYgvWozXFTeeTpAkMDQjBgp24xe7mIOlD3EiMwohgQ4kNrrKfb2EWwL6yRf/eDtLzRg7hU4pMNe9zU+cERSUU9Y9Ajsd+hf7yY/8LZxk3+UZrDyNe3cyA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764691039; c=relaxed/simple; bh=hQ2WHJnMDcLGs6EJh7Xx1VPKevMgHB2HKmx7J2VL8Xs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=hUHt0TM8k/lmgz3hRHkOyKtFylLlPgO5itbn2R533qznY8AxjItPWBBSO9H5y8ltxLQINKTdkdnCxVswuPQ92xbdUqF9/kDXgUSHH4JB2gcUW8E2ouoyLjpQ3VTn19Pre39VaAPKI/EdpqoINy7+lgmjHp4FCRH00DRGmnu6v7s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=AfSVDfiM; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="AfSVDfiM" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1CE90C4CEF1; Tue, 2 Dec 2025 15:57:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1764691039; bh=hQ2WHJnMDcLGs6EJh7Xx1VPKevMgHB2HKmx7J2VL8Xs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=AfSVDfiMEKpPawQOw81C+VKAKakZ/Lcnhf+M1JjLiue/2scxl2AX+6M8DToTae48v WZXEjoUuK8OCGGHFcGqHKiZ/4PMjgywfp6jQvPoENC44BxpRLrjHQ1lTBQtdfSXr8W DflFqhNBW2WviboQQksk4m5oj74/65wA8MLb/uXzzpCW+Lc6ifOqmoodpXx+z1+3qD tRJqIi5jbTHK9jfryKa0cmw9DfiMlKOVyxML9sUYOS0TseJJ8+RMiIkNokqoZho77x LfKb+YJhVVpWf0BIFu+gKd+K0rb+qlUI9FkO3kXvNsfin3yVt+kxQMxv0GQ2ggumE+ Sct5QD4U1BuWA== Date: Tue, 2 Dec 2025 16:57:14 +0100 From: Ingo Molnar To: Peter Zijlstra Cc: linux-kernel@vger.kernel.org, Juri Lelli , Dietmar Eggemann , Valentin Schneider , Vincent Guittot , Shrikanth Hegde , Linus Torvalds , Mel Gorman , Steven Rostedt , Thomas Gleixner Subject: Re: [PATCH 5/6] sched/fair: Rename cfs_rq::avg_load to cfs_rq::sum_weight Message-ID: References: <20251201064647.1851919-1-mingo@kernel.org> <20251201064647.1851919-6-mingo@kernel.org> <20251202102717.GB2556898@noisy.programming.kicks-ass.net> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20251202102717.GB2556898@noisy.programming.kicks-ass.net> * Peter Zijlstra wrote: > On Mon, Dec 01, 2025 at 07:46:46AM +0100, Ingo Molnar wrote: > > The ::avg_load field is a long-standing misnomer: it says it's an > > 'average load', but in reality it's the momentary sum of the load > > of all currently runnable tasks. We'd have to also perform a > > division by nr_running (or use time-decay) to arrive at any sort > > of average value. > > > > This is clear from comments about the math of fair scheduling: > > > > * \Sum w_i := cfs_rq->avg_load > > > > The sum of all weights is ... the sum of all weights, not > > the average of all weights. > > > > To make it doubly confusing, there's also an ::avg_load > > in the load-balancing struct sg_lb_stats, which *is* a > > true average. > > > > The second part of the field's name is a minor misnomer > > as well: it says 'load', and it is indeed a load_weight > > structure as it shares code with the load-balancer - but > > it's only in an SMP load-balancing context where > > load = weight, in the fair scheduling context the primary > > purpose is the weighting of different nice levels. > > > > So rename the field to ::sum_weight instead, which makes > > the terminology of the EEVDF math match up with our > > implementation of it: > > > > * \Sum w_i := cfs_rq->sum_weight > > > > Signed-off-by: Ingo Molnar > > Bah, this is going to be a pain rebasing for me, but yes, these > variables are poorly named. 'sum_weight' is a better name. Fair enough, and to make this easier for you I've rebased your worst affected tree (queue.git:sched/flat) on top of the mingo/tip:WIP.sched/core-for-v6.20 tree, which includes these renames (with all your feedback addressed AFAICT), see: git://git.kernel.org/pub/scm/linux/kernel/git/mingo/tip.git WIP.sched/flat ... and it builds and boots. :-) Thanks, Ingo