From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.16]) (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 A8FED413D9D for ; Fri, 15 May 2026 20:12:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778875951; cv=none; b=ptdVkEyKag7aXBS/3a9VeoFXc0lm6h60Zqq7sPy5DInRNxfLuiwLjaLZAjz6I8k5bOYVqp/abijAvOVkybeRNtVUXHmHOgLLQaxfAGug0ahnUWXli9j/HZL7nOhojadjBG0Tpf0k1HDpOkNjx5OrBPTtsnO/cE8JFUuI51TMpaY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778875951; c=relaxed/simple; bh=ULjL/g+Ylp6m3s9EYHg6vZnbpffXhsFLxGlCw/dpq3I=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=I4LlUT3cCIN1eZ2rpt3MdTV5darDQm16Ty8pxxzcs+W9KooNOa1Y8O5YqrpYKA+xHDbO763BYJ9kxniFRiNVKtKaycmYHxgfXN/Ri3+7wKHL/PjluK1W6OB934SOZirXXhjHdQN6YhoJY55YKqY8JX6h/x8uCx0oo12zTLgUmI4= 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=Q+pO3mit; arc=none smtp.client-ip=198.175.65.16 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="Q+pO3mit" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1778875949; x=1810411949; h=message-id:subject:from:to:cc:date:in-reply-to: references:content-transfer-encoding:mime-version; bh=ULjL/g+Ylp6m3s9EYHg6vZnbpffXhsFLxGlCw/dpq3I=; b=Q+pO3mit5p2DwmeFZZi6XaP5O4rK6tjx8Msd6erYN38Ug4DLNXD2CdIq GiPaGoYYAI7IlfzqfpAfI0OAr5HqGsgg3HpQcQaaYUpzdkuq82wyRfbes WaS88rrZJ2JdpuyrpReFXxYPlQ3hN8pAaPLi5tTvQfbOefH+kmjs8T3f4 tZZAa96DP+WYVwTyexzthFN17o71h87iYpC3PDM0f05bv3Wenxh+7MLuA r5zwtprSl9rnJxEgp0XDlOPH9qbbI3nkFzJ1+YGWWtBXpvXwEqyOn8gOF o2Giv7cDIFP4H4qekRo5YRpXkuwUUnxmWtg++rWfycP9L2HjplX7cFFSg A==; X-CSE-ConnectionGUID: H+G+cA+1QZusf3vBNKDubw== X-CSE-MsgGUID: Mp0P4AsaQ9+0oa89Nr27qg== X-IronPort-AV: E=McAfee;i="6800,10657,11787"; a="80007605" X-IronPort-AV: E=Sophos;i="6.23,236,1770624000"; d="scan'208";a="80007605" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa108.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 May 2026 13:12:29 -0700 X-CSE-ConnectionGUID: z6MvmaxcTMyH+w6P3Aylsg== X-CSE-MsgGUID: +72qpwHXSFiuejLoiNrq9A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.23,236,1770624000"; d="scan'208";a="239025750" Received: from schen9-mobl4.amr.corp.intel.com (HELO [10.125.108.218]) ([10.125.108.218]) by orviesa007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 May 2026 13:12:29 -0700 Message-ID: <6a2ae247d4a54d4b39c9295a0c1c1c680dba7ecc.camel@linux.intel.com> Subject: Re: [PATCH v3 2/4] sched/fair: Skip misfit load accounting when the destination CPU cannot help From: Tim Chen To: Ricardo Neri , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , Chen Yu , Christian Loehle , Barry Song Cc: "Rafael J. Wysocki" , Len Brown , ricardo.neri@intel.com, linux-kernel@vger.kernel.org Date: Fri, 15 May 2026 13:12:28 -0700 In-Reply-To: <20260514-rneri-fix-cas-clusters-v3-2-0037869554bd@linux.intel.com> References: <20260514-rneri-fix-cas-clusters-v3-0-0037869554bd@linux.intel.com> <20260514-rneri-fix-cas-clusters-v3-2-0037869554bd@linux.intel.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.58.1 (3.58.1-1.fc43) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On Thu, 2026-05-14 at 11:34 -0700, Ricardo Neri wrote: > In domains with asymmetric capacity, identifying misfit load in a > scheduling group is not useful when the destination CPU cannot help (i.e.= , > its capacity exceeds the group's maximum CPU capacity by less than ~5%). = In > such cases, it also prevents load balance among clusters of equal capacit= y > when CONFIG_SCHED_CLUSTER is enabled. This happens because > update_sd_pick_busiest() skips candidate groups of type misfit_task if th= e > destination CPU has similar capacity. >=20 > Skipping misfit load accounting in this situation allows the group to be > classified as has_spare or fully_busy and lets load balancing proceed. Ke= ep > marking scheduling groups as overloaded when misfit tasks are present. Th= e > sg_overloaded flag propagates to the root domain and allows bigger CPUs i= n > it to help via newly idle balance. >=20 > Reviewed-by: Christian Loehle > Signed-off-by: Ricardo Neri > --- > Changes in v3: > * Added Reviewed-by tag from Christian. Thanks! >=20 > Changes in v2: > * Moved the check of the destination CPU capacity inside the code block > used for SD_ASYM_CPUCAPACITY. v1 inadvertently broke the mutual > exclusion of the sched_reduced_capacity() path. > * Keep marking the root domain as overloaded to allow bigger CPUs to > help. (sashiko) > * Fixed patch description to clarify that the capacity_greater() looks > for differences of 5% or more. (Christian) > * Reworded the patch description for clarity. > * I did not include the Reviewed-by tag from Christian since the patch > changed functionally. > --- > kernel/sched/fair.c | 20 +++++++++++++++++--- > 1 file changed, 17 insertions(+), 3 deletions(-) >=20 > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > index e06e74d9ce0e..dcc02ceb44b5 100644 > --- a/kernel/sched/fair.c > +++ b/kernel/sched/fair.c > @@ -10749,10 +10749,24 @@ static inline void update_sg_lb_stats(struct lb= _env *env, > continue; > =20 > if (sd_flags & SD_ASYM_CPUCAPACITY) { > - /* Check for a misfit task on the cpu */ > - if (sgs->group_misfit_task_load < rq->misfit_task_load) { > - sgs->group_misfit_task_load =3D rq->misfit_task_load; > + if (rq->misfit_task_load) { > + /* > + * Always mark the domain overloaded so big CPUs > + * can pick up misfit tasks via newly idle > + * balance. > + */ > *sg_overloaded =3D 1; > + > + /* > + * Only account misfit load if @dst_cpu can > + * help; otherwise, the group may be classified > + * as misfit_task and update_sd_pick_busiest() > + * will skip it. You mean "sd_pick_busiest() will pick it" instead of "skip it" for misfit t= ask load balancing in the above comment? Tim > + */ > + if (capacity_greater(capacity_of(env->dst_cpu), > + group->sgc->max_capacity) && > + (sgs->group_misfit_task_load < rq->misfit_task_load)) > + sgs->group_misfit_task_load =3D rq->misfit_task_load; > } > } else if (env->idle && sched_reduced_capacity(rq, env->sd)) { > /* Check for a task running on a CPU with reduced capacity */