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 A006E3E315C 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=1774909358; cv=none; b=P8X/QA0UFyggJF//Ca7+kRramvt91djYnY9NrceOaYi/ln/znk/3jnblKwYvYSgGF/PijBceeAvvA70+m+0kNbbTBTbHlyUim9OOnLzrzp1MJymda5UwfR6FFK8X6cSi4N/4wRKwFzHLLo73eRUxkooUXEDxb1exm23hniMRNKA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774909358; c=relaxed/simple; bh=9GX3wmoEmfqSCzbnh3QdFetERHUu7YbKgD/DnlJFAg4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=dBMBXBbque1duMaguCXpTIYB0zh2j4nnF3xy5SS86Nuzq8ueK96mssOYhufThdrHQxIGqlYd5TVMMXMJtoDHn/tOQl8u/lQM5lM6n4pwWI7KbDp8cS2SeTKgxaDf1hAsDb6VACROV47LkiibKQmUAalQZ+Fbo1kNq50gftlxgjo= 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=iYIyp1or; 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="iYIyp1or" 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=9GX3wmoEmfqSCzbnh3QdFetERHUu7YbKgD/DnlJFAg4=; b=iYIyp1orCFeBC5msUyZmYy4EvUXwjUtjbj6Aq2MqY2L8dnq+d/uEbC7U zbGVvozWEkYQ0UU2uXhy7b38SBF35mNbFKGIswmXB/QvuVCf955ONUkmp orpacIwIAyt8gIZanYx9EzQ8Rt91JF+pJPzjxZ84tddJ18R9qftKcOgUz ahU0YQ0E5ziQLKSsTsA8xjA9E58MtI5aNAEOPI+nLHY7vvvj+xVc6pTFj P9ba9KbuBnAiMp5RB6n+qTyvmA3uOdRpWZ1ghlqa9MVnjDhoAJ28KowZt OlHna4TkERyCjesAlmIcDsySrEOorVuQVR3iSgMBeauEvsHHV3yR5KrHZ g==; X-CSE-ConnectionGUID: fUJGPNVVRhqDNLiD+Gt3aw== X-CSE-MsgGUID: hXcqikrSSIu2KqHVvSl/Iw== X-IronPort-AV: E=McAfee;i="6800,10657,11744"; a="86606158" X-IronPort-AV: E=Sophos;i="6.23,150,1770624000"; d="scan'208";a="86606158" 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: j2/cc7W0S4q/yOF8fNAsXw== X-CSE-MsgGUID: Nv5niQz5TpuhV9Te/g0+7Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.23,150,1770624000"; d="scan'208";a="230242290" 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:37 -0700 Subject: [PATCH RESEND 3/4] sched/fair: Allow load balancing between CPUs of equal capacity 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-3-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=1174; i=ricardo.neri-calderon@linux.intel.com; s=20250602; h=from:subject:message-id; bh=9GX3wmoEmfqSCzbnh3QdFetERHUu7YbKgD/DnlJFAg4=; b=6omSPE5ycj1ifEBRhmImWQfRTGWUYrAnklc8kJViRmO7ws1YGLNRK8GQmUHqH5QbEl9XtmZxX ejHUYg23OdaAgtSaOwN+E+xpp/jvOmy5ZJgSPiiSIJZnHGP/EKBwR0+ X-Developer-Key: i=ricardo.neri-calderon@linux.intel.com; a=ed25519; pk=NfZw5SyQ2lxVfmNMaMR6KUj3+0OhcwDPyRzFDH9gY2w= sched_balance_find_src_rq() is supposed to avoid picking as busiest a runqueue with a single running task since that would result in the task migrating to a lower-capacity CPU. It also prevents migrations between CPUs of equal capacity. Migrating tasks between CPUs of equal capacity helps when balancing load in a scheduling domain in which there are CPUs of different capacity and are grouped in clusters of CPUs of equal capacity that share L2 cache. Load should be balanced among these clusters when CONFIG_SCHED_CLUSTER is enabled. Signed-off-by: Ricardo Neri --- kernel/sched/fair.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 3c50ecffa4c7..a7fd4f1f4348 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -11388,6 +11388,7 @@ static struct rq *sched_balance_find_src_rq(struct = lb_env *env, * average load. */ if (env->sd->flags & SD_ASYM_CPUCAPACITY && + capacity_of(env->dst_cpu) !=3D capacity && !capacity_greater(capacity_of(env->dst_cpu), capacity) && nr_running =3D=3D 1) continue; --=20 2.43.0