From nobody Wed Apr 1 11:16:22 2026 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.9]) (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 344FF3E314C for ; Mon, 30 Mar 2026 22:22:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.9 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774909347; cv=none; b=iKE1RSyYptxc2AbrcGR7IlOKrWI7f8FZbK/4s6dvOUb11TaxcblC2LobDEchfQGbhltHmX8Sh5RdIr6ZxJm947+2QmC9gVy9b+pvo2YpzsQbw5lOaB+MoX4g3beAE/d/YBfxq+grKcCivAnp52cC8ZVkV3mzRZZ/+uedwxGClCU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774909347; c=relaxed/simple; bh=7YqlhjvelHHRmIPxxW3bFPLGOmOO13E0rrCXAYV/vfg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=G2P/1qRr6kUFAXKnn8IJWc27BWfiaT5R9mTQNcs5FOhzOqj05JjLZKBRKLQDRn2eeUU82z9+/4lopwk6Zfpv4Xp9T6RifDJZu+/rPboAGpKkC5KWr/LDuNc/7ruKEYSyFXRsWrGb2hxsOkzZJ8RMrySgVojKQeUc+tda1E/XG8Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=OMT8V+S9; arc=none smtp.client-ip=192.198.163.9 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="OMT8V+S9" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1774909336; x=1806445336; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=7YqlhjvelHHRmIPxxW3bFPLGOmOO13E0rrCXAYV/vfg=; b=OMT8V+S9fZZWaCzwCzJIGrnoq0fs4vOxSXDovZtNGqMvLyvh/lzjYYK9 6peitFNdonfpn9lTqWSKPpvH+i108DCqa5qPrB2RML5icSSPmfUYE+dFv OCsNbpouQlm9DkYRI/inDYAZ6tXSBywSDp61yDA4RW41AkU4sI5nvnbsM tIXWFmWDqJD4n10nODQm26lxqaqRp/AQ2MugHsU94VX1eBxnzYfCKQW1s 8Ep3v7uOHHEW847aeIEozMAKWJIyR1HlREtI0EenP8ys6xhor0JcjwSXW aHYIwDBWj2y/9LUAuO7Ar2+JUngB3CLK4VtyAOIiwuUIA2jGpFQlym4nS g==; X-CSE-ConnectionGUID: rfkqLS99RRSaBvqmYfjmyA== X-CSE-MsgGUID: 96L9V4YpQ0KOO6VlqOlEPg== X-IronPort-AV: E=McAfee;i="6800,10657,11744"; a="86606139" X-IronPort-AV: E=Sophos;i="6.23,150,1770624000"; d="scan'208";a="86606139" Received: from orviesa003.jf.intel.com ([10.64.159.143]) by fmvoesa103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Mar 2026 15:22:14 -0700 X-CSE-ConnectionGUID: 4D7sXyzjQ2uahjmL1TxXdg== X-CSE-MsgGUID: FSxOR1ALR4SAIhqwS/lBmw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.23,150,1770624000"; d="scan'208";a="230242282" Received: from unknown (HELO [172.25.112.21]) ([172.25.112.21]) by orviesa003.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Mar 2026 15:22:14 -0700 From: Ricardo Neri Date: Mon, 30 Mar 2026 15:20:35 -0700 Subject: [PATCH RESEND 1/4] sched/fair: Always skip fully_busy higher-capacity groups for load balance 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="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260330-rneri-fix-cas-clusters-v1-1-1e465b6fecb2@linux.intel.com> References: <20260330-rneri-fix-cas-clusters-v1-0-1e465b6fecb2@linux.intel.com> In-Reply-To: <20260330-rneri-fix-cas-clusters-v1-0-1e465b6fecb2@linux.intel.com> To: Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , Tim C Chen , Barry Song Cc: "Rafael J. Wysocki" , Len Brown , ricardo.neri@intel.com, linux-kernel@vger.kernel.org, Ricardo Neri X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1774909272; l=2176; i=ricardo.neri-calderon@linux.intel.com; s=20250602; h=from:subject:message-id; bh=7YqlhjvelHHRmIPxxW3bFPLGOmOO13E0rrCXAYV/vfg=; b=oyFyxIpB4A2DSfAVdwThY8jUGbp1dhcBTO9Nz4VJ5xlYrnbpwnXHQDpbwoxdaMilIXP692IcP mFNAyT5a6SQDmZeMUUfI2/gIP3BG0cMcYXooNLOrRFPoo6eK9LH/RTB X-Developer-Key: i=ricardo.neri-calderon@linux.intel.com; a=ed25519; pk=NfZw5SyQ2lxVfmNMaMR6KUj3+0OhcwDPyRzFDH9gY2w= update_sd_pick_busiest() is supposed to avoid picking as busiest a candidate scheduling group with no more than one task if its per-CPU capacity is greater than that of the destination CPU. update_sd_pick_busiest() selects as busiest a group if its type is greater than has_spare (the type of the busiest group is initialized as has_spare). As a result, a fully_busy group with higher per-CPU capacity can still be selected as busiest. Relocate the existing comparison of capacities to occur before comparing the types of the candidate and busiest groups. Remove unnecessary parentheses while here. Signed-off-by: Ricardo Neri --- kernel/sched/fair.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 7e2963efe800..9da5014f8387 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -10372,6 +10372,17 @@ static bool update_sd_pick_busiest(struct lb_env *= env, sds->local_stat.group_type !=3D group_has_spare)) return false; =20 + /* + * Candidate sg has no more than one task per CPU and has higher + * per-CPU capacity. Migrating tasks to less capable CPUs may harm + * throughput. Maximize throughput, power/energy consequences are not + * considered. + */ + if (env->sd->flags & SD_ASYM_CPUCAPACITY && + sgs->group_type <=3D group_fully_busy && + capacity_greater(sg->sgc->min_capacity, capacity_of(env->dst_cpu))) + return false; + if (sgs->group_type > busiest->group_type) return true; =20 @@ -10474,17 +10485,6 @@ static bool update_sd_pick_busiest(struct lb_env *= env, break; } =20 - /* - * Candidate sg has no more than one task per CPU and has higher - * per-CPU capacity. Migrating tasks to less capable CPUs may harm - * throughput. Maximize throughput, power/energy consequences are not - * considered. - */ - if ((env->sd->flags & SD_ASYM_CPUCAPACITY) && - (sgs->group_type <=3D group_fully_busy) && - (capacity_greater(sg->sgc->min_capacity, capacity_of(env->dst_cpu)))) - return false; - return true; } =20 --=20 2.43.0