From nobody Wed Apr 1 11:16:23 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 B22373E3D90 for ; Mon, 30 Mar 2026 22:22:27 +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=1774909357; cv=none; b=s154XB+YUiw4SGpTByw6vRCjyQcrigpicGjGkPSqocVEYywnlM0RQtM+z8pXC1RTgSuuK7ip93yxPv4r26A4S7eIgSMtoAiEh0hIMSQjo1TXbQxvytgG3v0B+uBdGIMBxL/NL9OK67vARpWRdPgEdEuJMVDHVts+fIaBeUOHMY0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774909357; c=relaxed/simple; bh=SXgoQ1idQ/QAggHeUOTb6B7xD04V/Ud51LpI1El6PZc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=uJ3AJsTWy9QKlCCIWRkm4bBjPbXaN7DY+OyuYQYwT7AwCjrNUHNAPA2U0/Ksj04EvQstX9re+kKYtOD6ntGcYf4ExUgVbcX0GorEWN9z5WFF57FAE1TTxiGbEfyihAB0lgDaGECeb7mbLhpw7yYLBv8OO7tAvv2z8CzIGTODnNY= 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=G5ogtlxG; 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="G5ogtlxG" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1774909348; x=1806445348; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=SXgoQ1idQ/QAggHeUOTb6B7xD04V/Ud51LpI1El6PZc=; b=G5ogtlxGP+KM1blH7JVix97vs9bbwSgkiSLOZ10JjW9dNYWF00+Hxi8c rAGEytGvfqQlSrDIPX+9yvND2sJcJdAEDUFvIeAlc/St5Nrlfue3ZSkAs Tm6qOwaVbgBXj66v/YFL2qdFV0DQFElzi1lks+EA46D7XiC7cvtpMZFjS ltRhVhel/8tEmNTu1Sxo5LLAWhEMvNGXSy2hKGMxlSTSHUCjdb0U4AuRG BldZexkvy1tm66Hh0ViEF/Ww2jNi1g0nrDkzeRb6QzjE/hWWlR6dOHZai aoaStu1UNb4sbVy7COZyy1GD/xCrLyT4pQhiKWaQBg0SM3FXWOTUmELwL Q==; X-CSE-ConnectionGUID: 4JzD5e3EQTSxU8/oCZTrsw== X-CSE-MsgGUID: wMkRRldiQ4GrkXlkofQG5w== X-IronPort-AV: E=McAfee;i="6800,10657,11744"; a="86606168" X-IronPort-AV: E=Sophos;i="6.23,150,1770624000"; d="scan'208";a="86606168" 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:15 -0700 X-CSE-ConnectionGUID: k9fI1MC6Rfe5jLRftnmkVw== X-CSE-MsgGUID: 2k61cJ5BSAyHM0BksGieEw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.23,150,1770624000"; d="scan'208";a="230242296" 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:38 -0700 Subject: [PATCH RESEND 4/4] sched/topology: Keep SD_PREFER_SIBLING for domains with clusters 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-4-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=1754; i=ricardo.neri-calderon@linux.intel.com; s=20250602; h=from:subject:message-id; bh=SXgoQ1idQ/QAggHeUOTb6B7xD04V/Ud51LpI1El6PZc=; b=e35cN2IMWMawDaBSo4ef1md2e/4coc1b8aEH+gVM6QAaj448mDuWMO2dZx+g0dy61Lntfz5B6 llj0soUiw+ABnl3+gddFFeCbthpykLdrATz8tS8+ZMzcIxZqQVtYWOO X-Developer-Key: i=ricardo.neri-calderon@linux.intel.com; a=ed25519; pk=NfZw5SyQ2lxVfmNMaMR6KUj3+0OhcwDPyRzFDH9gY2w= There are topologies with scheduling domains that contain CPUs of asymmetric capacity and grouped into two or more clusters of CPUs of equal capacity sharing L2 cache. CONFIG_SCHED_CLUSTER requires to balance load among clusters sharing a resource. Keep the SD_PREFER_SIBLING in the child domains to indicate to the load balancer that it should spread load among cluster siblings. Checks for capacity in the load balancer will prevent migrations from high- to low-capacity CPUs. Likewise, misfit load will still be used to move high-load tasks to bigger CPUs. Remove unnecessary parentheses while here. Signed-off-by: Ricardo Neri --- kernel/sched/topology.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c index 8e06b1d22e91..61786cfdc78f 100644 --- a/kernel/sched/topology.c +++ b/kernel/sched/topology.c @@ -1689,8 +1689,15 @@ sd_init(struct sched_domain_topology_level *tl, /* * Convert topological properties into behaviour. */ - /* Don't attempt to spread across CPUs of different capacities. */ - if ((sd->flags & SD_ASYM_CPUCAPACITY) && sd->child) + /* + * Don't attempt to spread across CPUs of different capacities. An + * exception to this rule are domains in which there are clusters of + * CPUs sharing a resource. Keep the flag in such case to balance load + * among them. The load balancer will prevent task migrations from + * high- to low-capacity CPUs. + */ + if (sd->flags & SD_ASYM_CPUCAPACITY && sd->child && + !(sd->child->flags & SD_CLUSTER)) sd->child->flags &=3D ~SD_PREFER_SIBLING; =20 if (sd->flags & SD_SHARE_CPUCAPACITY) { --=20 2.43.0