From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (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 87DC623D297 for ; Fri, 28 Nov 2025 13:58:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764338314; cv=none; b=BNJw3Sq1HV8nNyqCkgE2bqfLM50XiVf63cahgwoVzIvotaPvUAan2w3ItEYWIopUBQzarQd0e0ApALyiZxwGFtPG19KFg0pZR93zeEJ5a/9TFqbMCz10+7je5ViKwHtrR4mbF36vH7VRx+NkOW+iFG+CHI+cmKb9v9wI1la5yAU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764338314; c=relaxed/simple; bh=5u3A1kX/9SU06PSa6CCXp0yffkCTf/78ghWIoghVJ/Q=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=FHst2pwCyN5IAdBbwktMWRfNyVLKF6k2JUHHZJ/ueV+2Xa3eiYPhXjLznlLeq6mpOem6MJ+Ui2+gvw6pPfvxFZ7x7RFtpVS+unOx+pNYHQucGWrxJENI48lY/UCW2oQzmL9IlaFbmefiyD9FK+eXGZfnwWpjVof0cLMvoecz3nk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=qpiy7tSa; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="qpiy7tSa" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=CCqVfyAgXDBJQO8pOjXhmQT9w7GMldO1jtUi3x0SYgo=; b=qpiy7tSaL22ejJ+bKPd8hOU436 qZl4OImfHNT6VB8gavxYGupd9K1Pc/cF7KC/JiT2tbtzi9/U6Er4OzRr88ysLm4CtZeVa4SILJgYv 8IA8zmTUdXx2SS9WudxwEOt9/q8qPAp2sLCmbEYzhAvmeoxwDaK1xaIOQDySBWkBTi6OjDtm580dk PqxaPkrwV1HPxUyINKKMkXPfjzSJn98TyP8XVKmpJQJ2MFAIDcOUTbqK+dmXiZUogydNksk8VJYZf RGRhn/CD0vlPM8ad89IQWp0XSc06ctsgp8qrDNGhewGgQhCjfC+8HyU549leCmgw1oHHRZ4O5nEcg yp/inmKg==; Received: from 77-249-17-252.cable.dynamic.v4.ziggo.nl ([77.249.17.252] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.98.2 #2 (Red Hat Linux)) id 1vOyzR-0000000DHRT-3sw6; Fri, 28 Nov 2025 13:58:26 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id 6DA8D3002E3; Fri, 28 Nov 2025 14:58:25 +0100 (CET) Date: Fri, 28 Nov 2025 14:58:25 +0100 From: Peter Zijlstra To: Vincent Guittot Cc: Fernand Sieber , mingo@redhat.com, linux-kernel@vger.kernel.org, juri.lelli@redhat.com, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, vschneid@redhat.com, kprateek.nayak@amd.com, dwmw@amazon.co.uk, jschoenh@amazon.de, liuyuxua@amazon.com, abusse@amazon.com, gmazz@amazon.com, rkagan@amazon.com Subject: Re: [PATCH] sched/fair: Force idle aware load balancing Message-ID: <20251128135825.GC4067720@noisy.programming.kicks-ass.net> References: <20251127202719.963766-1-sieberf@amazon.com> 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: On Fri, Nov 28, 2025 at 02:55:36PM +0100, Vincent Guittot wrote: > On Thu, 27 Nov 2025 at 21:28, Fernand Sieber wrote: > > @@ -10135,15 +10136,15 @@ static inline int sg_imbalanced(struct sched_group *group) > > static inline bool > > group_has_capacity(unsigned int imbalance_pct, struct sg_lb_stats *sgs) > > { > > - if (sgs->sum_nr_running < sgs->group_weight) > > + if (sgs->sum_nr_running < (sgs->group_weight - sgs->forceidle_weight)) > > return true; > > > > - if ((sgs->group_capacity * imbalance_pct) < > > - (sgs->group_runnable * 100)) > > + if ((sgs->group_capacity * imbalance_pct * (sgs->group_weight - sgs->forceidle_weight)) < > > + (sgs->group_runnable * 100 * sgs->group_weight)) > > so you apply a ratio on group capacity based on the number of forced > idle but what if you have heterogeneous systems ? Ah, good point. I suppose tracking force_idle_capacity in update_sg_lb_stats() should be possible, and then subtract that from group_capacity or so.