From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fra-out-012.esa.eu-central-1.outbound.mail-perimeter.amazon.com (fra-out-012.esa.eu-central-1.outbound.mail-perimeter.amazon.com [52.57.120.243]) (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 45D9A2ED843 for ; Mon, 1 Dec 2025 13:04:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=52.57.120.243 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764594249; cv=none; b=O+TUOgGMyZmwNtQ2EeqC3/DeX4d6DTomxhh1EFFYlWfow19Z0CnGTIrio+8ovKiLsuwynhTsgHPLKQRAuwKugEcMbbAoWXfDRYOKik+KAuuIGv9/MN2oGtONG/fO95sGgcL1cmEd/mz276mH2i18diaa6/NfnDQfbYCCjw9P8mA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764594249; c=relaxed/simple; bh=DNKKT/QPhf/VX4G0oSe0ijLKm7DvM8GnZ+1ri+VrdOY=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=H3ve1k3wMD4mSmAu/Q/EfSfkAX9xuX6yGD70CuZ2w9+SD6TOxDWQuo0zQsUZdyVDu/e6OfME5FbB8xI4ferRxo5wN9JYeAnSql0rwCKdbMYLlh5nFA9N7AR++Z9jPUSKUfiNi3mFZLGGk7/33lh0t2e6WH2BrIVEIG+PcoqQhWU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amazon.com; spf=pass smtp.mailfrom=amazon.com; dkim=pass (2048-bit key) header.d=amazon.com header.i=@amazon.com header.b=jcFgxsex; arc=none smtp.client-ip=52.57.120.243 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amazon.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=amazon.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=amazon.com header.i=@amazon.com header.b="jcFgxsex" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazoncorp2; t=1764594247; x=1796130247; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=XRrf2lXA5OIsLJR/iKLrsF77YecD3GCmrvefctzlsNc=; b=jcFgxsexkkX6dm/LplFh1+iM03uQCKvYwX8DSHOi3yLfuO1Iay1vYmKq Pxfk9kBZOc78a2VDYtdNesH9g6k8nq3hdjUC7K/Y1LFPRn1Dgq12o1mzz 4gId/5hfJYNPqGzMzZxx4lRHy6mdyE6cb1FBP4AdybHENQEw7TEmE1YEw N2E8Lo3zbWErVn25RxpWwrTFYX9DO4mYeADMT1C6lGKZfD+tdwTtkPzz6 X0C8jH1m8lRnHgdM3pcaeQm2WkjbYjZOfaz4au4Qf/xB/Ew9NO/lPYVwt 2Og0WG0agnYUKHKQ0CS6+IOvy/PzeakFFu3uzuSNpE2GCvTECy7PGFD59 Q==; X-CSE-ConnectionGUID: 3JezPue7QXK5+tkN5DjmlQ== X-CSE-MsgGUID: OmEJeEuZQtiq9FNRc5DFng== X-IronPort-AV: E=Sophos;i="6.20,240,1758585600"; d="scan'208";a="5959451" Received: from ip-10-6-3-216.eu-central-1.compute.internal (HELO smtpout.naws.eu-central-1.prod.farcaster.email.amazon.dev) ([10.6.3.216]) by internal-fra-out-012.esa.eu-central-1.outbound.mail-perimeter.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Dec 2025 13:02:56 +0000 Received: from EX19MTAEUA002.ant.amazon.com [54.240.197.232:30699] by smtpin.naws.eu-central-1.prod.farcaster.email.amazon.dev [10.0.31.35:2525] with esmtp (Farcaster) id 52513002-e582-4631-a7d7-8c1dc3821acd; Mon, 1 Dec 2025 13:02:56 +0000 (UTC) X-Farcaster-Flow-ID: 52513002-e582-4631-a7d7-8c1dc3821acd Received: from EX19D003EUB001.ant.amazon.com (10.252.51.97) by EX19MTAEUA002.ant.amazon.com (10.252.50.126) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.2562.29; Mon, 1 Dec 2025 13:02:52 +0000 Received: from u5934974a1cdd59.ant.amazon.com (10.146.13.109) by EX19D003EUB001.ant.amazon.com (10.252.51.97) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.2562.29; Mon, 1 Dec 2025 13:02:43 +0000 From: Fernand Sieber To: Peter Zijlstra CC: Vincent Guittot , , , , , , , , , , , , , , , , Subject: Re: [PATCH] sched/fair: Force idle aware load balancing Date: Mon, 1 Dec 2025 15:02:23 +0200 Message-ID: <20251201130224.274217-1-sieberf@amazon.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251128135825.GC4067720@noisy.programming.kicks-ass.net> References: <20251127202719.963766-1-sieberf@amazon.com> <20251128135825.GC4067720@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 X-ClientProxiedBy: EX19D042UWA002.ant.amazon.com (10.13.139.17) To EX19D003EUB001.ant.amazon.com (10.252.51.97) Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On Fri, 28 Nov 2025 at 14:58, Peter Zijlstra wrote: > 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. Thanks. Addressed in rev2, by keeping track of both forceidle_weight and forceidle_capacity: https://lore.kernel.org/lkml/20251201124223.247107-1-sieberf@amazon.com/ Amazon Development Centre (South Africa) (Proprietary) Limited 29 Gogosoa Street, Observatory, Cape Town, Western Cape, 7925, South Africa Registration Number: 2004 / 034463 / 07