From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) (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 0DAD135F8A8 for ; Thu, 2 Apr 2026 04:21:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.8 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775103686; cv=none; b=G80uTOpRu8aWYAYT6BsqC9HghhwYixEblHt2yR3eXQdeEpB4AOd6wvOeDnwHvH0RP1Awv+t5LoUiGr9jw85MGd4q/fBJTr93/AywdORuqCbh00cU3d74idiFMmj+HXikj62E4wfZf22jPEwTJyWTYiKNZqU6PkrEvqeHZe8lnM8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775103686; c=relaxed/simple; bh=neDxUk3L4M85H2MNmR7uwPMaKDyrtnslJc0eGjXTcmw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=SB0z8lb4eUtf7Q5llv4izbRO3NuF5uuKZETvijP/j2LDlGD6VgnZ7TqKfQOP+4BNdpRCo3CIfo9nOpa4SHiAb+EQC3ujhXG2TlRp7zn0ltrxbd7CJtYQ52i6BRgzthPv00ocHxREQWxumpoKbBLmXQ5FzmWV3YpkbKAKrv+wKlg= 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=B7zoLP/E; arc=none smtp.client-ip=192.198.163.8 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="B7zoLP/E" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1775103685; x=1806639685; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=neDxUk3L4M85H2MNmR7uwPMaKDyrtnslJc0eGjXTcmw=; b=B7zoLP/EFtpgLLbc9AL6WtiGZDZe68qcygBuEyfoxUxigA0qdDEE5Ya3 GaI0c2MCIMAaSneayPIOzPeEYlJSct6oY3yiMlv5gv2iMrKRWLwXMTwI/ PxTihlmqW2/HBiPrORIcM1lvaxlhpeShJt/DDBZ5XTt8agbB8KhEtmsNx +2HwT6uOh7FONzlaQe5LzIYq4xZ8wYyxzxbNMfgOlxCEXJtduKFiiCXTd Q70zBI8JoIJQqVpiqk6vqab/Jq7UwQ2QuPV6MBCqc7IrCZJtbVnLCfGOm LHRFWC9pxSpz4InNJY2xW2aBytEIrs+tCwHHS2tNt5A0h1iISooswAZ+8 Q==; X-CSE-ConnectionGUID: SqrQkg4eSlueszKVp+LEUw== X-CSE-MsgGUID: PUIKUm3PS4K6rqNN4PS59g== X-IronPort-AV: E=McAfee;i="6800,10657,11746"; a="93737357" X-IronPort-AV: E=Sophos;i="6.23,155,1770624000"; d="scan'208";a="93737357" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Apr 2026 21:21:24 -0700 X-CSE-ConnectionGUID: UfqA4I4ZTo+iFl1BYry0MA== X-CSE-MsgGUID: AKzqN+k0SaKRX6wvZI++Og== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.23,155,1770624000"; d="scan'208";a="226843899" Received: from ranerica-svr.sc.intel.com ([172.25.110.23]) by orviesa008.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Apr 2026 21:21:23 -0700 Date: Wed, 1 Apr 2026 21:27:18 -0700 From: Ricardo Neri To: Christian Loehle Cc: Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , Tim C Chen , Barry Song , "Rafael J. Wysocki" , Len Brown , ricardo.neri@intel.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH RESEND 2/4] sched/fair: Ignore misfit load if the destination CPU cannot help Message-ID: <20260402042718.GA15200@ranerica-svr.sc.intel.com> References: <20260330-rneri-fix-cas-clusters-v1-0-1e465b6fecb2@linux.intel.com> <20260330-rneri-fix-cas-clusters-v1-2-1e465b6fecb2@linux.intel.com> 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=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) On Wed, Apr 01, 2026 at 10:30:53AM +0100, Christian Loehle wrote: > On 3/30/26 23:20, Ricardo Neri wrote: > > There is no point in identifying scheduling groups with misfit tasks if the > > destination CPU cannot help (i.e., it has less than 20% greater capacity > > than the most performant CPU in the group). Thanks for looking at the patches Christian! > > There's a mismatch here because capacity_greater() is 5%? > You could use 20% fits fits_capacity() I'd say it's too strict here. My intent was to describe the difference as 5%. I made a mistake here. I think checking for a 5% mismatch is more appropriate since should skip misfit load if dst_cpu and the max per-CPU capacities are similar. > > > > > Since migrating misfit tasks takes precedence over relieving fully_busy > > groups, identifying a group with misfit tasks causes a destination CPU of > > smaller maximum capacity to back off (see capacity checks in update_sd_ > > pick_busiest()) even if it can help: it could help a group of equally small > > maximum capacity if classified as fully_busy or has_spare. > > > > The described situation can happen if a scheduling domain has groups of > > big CPUs alongside two or more clusters of smaller CPUs that share L2 > > cache. Load should be balanced between these sets of smaller CPUs when > > CONFIG_SCHED_CLUSTER is enabled. > > > > Signed-off-by: Ricardo Neri > > --- > > kernel/sched/fair.c | 4 +++- > > 1 file changed, 3 insertions(+), 1 deletion(-) > > > > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > > index 9da5014f8387..3c50ecffa4c7 100644 > > --- a/kernel/sched/fair.c > > +++ b/kernel/sched/fair.c > > @@ -10302,7 +10302,9 @@ static inline void update_sg_lb_stats(struct lb_env *env, > > if (local_group) > > continue; > > > > - if (sd_flags & SD_ASYM_CPUCAPACITY) { > > + /* Only look for misfit load if dst_cpu can help */ > > + if (sd_flags & SD_ASYM_CPUCAPACITY && > > + capacity_greater(capacity_of(env->dst_cpu), group->sgc->max_capacity)) { > > /* Check for a misfit task on the cpu */ > > if (sgs->group_misfit_task_load < rq->misfit_task_load) { > > sgs->group_misfit_task_load = rq->misfit_task_load; > > > > Apart from the above nit: > > Reviewed-by: Christian Loehle Thank you!