From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2CBE13F9272 for ; Fri, 5 Jun 2026 10:35:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780655734; cv=none; b=L5YrHYUfozbYPNNC/NyhQpP0R/rIXAnGoykYdYfLxyLKeBBQGypKe+6UiEP7xrOkHn4qSuMisgM8dCtdf5amR6EriowHiceBQZh3BEIM/vIKT2sBn4wkJeatebO/u4HuhF3yOXpZ4TdCzH22Kvl32BsHwuV50evwq9yFYN96zq4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780655734; c=relaxed/simple; bh=skDLP16eD4+Tw8jaNSdOeYKmJaBhyFI4PhiQ++ZfkHQ=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=kFpOd8pea5dEql532GKiFGajbWjrfUUP2Q1BOVcJtoZZYHQ3cChp+RGNuB+rvHzI7Exn7w25LY7M0kTNt5QiNOg0yMmVZ1DrPly233kJY880NCMJHYs0363kPGyDozUPM1DMOfp8c2Ut+LenxnYRnSpP0AB57kngxTrmmqHjvN8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b=DGYQ6kxe; arc=none smtp.client-ip=217.140.110.172 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b="DGYQ6kxe" 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 82F7B16F8; Fri, 5 Jun 2026 03:35:26 -0700 (PDT) Received: from [10.57.73.152] (unknown [10.57.73.152]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 54E2B3F632; Fri, 5 Jun 2026 03:35:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1780655731; bh=skDLP16eD4+Tw8jaNSdOeYKmJaBhyFI4PhiQ++ZfkHQ=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=DGYQ6kxeqGPOTA3IAklvA4AXRjdGYMYQmk/3p2ThjcI7GIvRF9FwMf0ykyI4DnZ2M VzFrrXDGFVYHLmlLUzdr0IgxN/MnId63+oP4EzXjdCPw7GyGJcD/NePZ79BkxNXu94 Al2Urg2stHsdmLqFirjk92BmNxwXKq9T2/4iXggw= Message-ID: Date: Fri, 5 Jun 2026 12:35:27 +0200 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: [PATCH v2] sched/fair: Fix cpu_util runnable_avg arithmetic To: Hongyan Xia , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , K Prateek Nayak Cc: Jiazi Li , "linux-kernel@vger.kernel.org" References: <20260605094318.37931-1-hongyan.xia@transsion.com> From: Dietmar Eggemann Content-Language: en-GB In-Reply-To: <20260605094318.37931-1-hongyan.xia@transsion.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 05.06.26 11:43, Hongyan Xia wrote: > From: Hongyan Xia > > If we take runnable_avg in max(runnable_avg, util_avg) in cpu_util(), we > should then add or subtract task runnable_avg, but the arithmetic below > is still with task util_avg. This mixes runnable_avg with util_avg which > is incorrect. > > Fix by always doing arithmetic with runnable_avg and only take > max(runnable_avg, util_avg) at the last step. > > Fixes: 7d0583cf9ec7 ("sched/fair, cpufreq: Introduce 'runnable boosting'") > Signed-off-by: Hongyan Xia Does this fix the issue in EAS energy calculation you mentioned initially? We now add/subtract task rbl_avg from CPU rbl_avg but can we now use this value correctly in util_avg based EAS? How do you want to solve the power consumption regression in you low-power use cases? Since you mentioned per-CPU tasks in those contention scenarios (per-CPU worker vs producer *), do you plan to only use boost in cpu_util() in case the affinity of p (worker) is not constrained? Not sure whether the consumer (CPU affinity not constrained) also has rbl_avg > util_avg? * https://lore.kernel.org/r/4adbab4d-f9e4-4354-aa1e-48f11b1fd208@transsion.com [...]