From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (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 2BE6944102D for ; Fri, 15 May 2026 10:10:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.156.1 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778839826; cv=none; b=Sy/MTyKyHs1VundLOptRrxmjVlQKHl7d9XOUBw2SQtAWi58zJY7VIjb5hmVx3wYwfLUdOVZRpoo/ia7yJp99wVZu+JCW3q59MEZtPwDCRdi/RxcDSCYMEXdXuI/K2rUPKLldN0OpZAdRhMgm9Ibq5RsD++xw0cHGReUbkVLyeFk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778839826; c=relaxed/simple; bh=pFPvQg9ZT7tJbSDIM7gfnYlM5Q7L2gtinZ70J3OEmjg=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=kO4X0CZFZU5KWYXi5rdYenW51MUtIK/7/qsLGlT9Zu1zOqc8HupSafI6UTXuZrt+3cB4KLynJ1IeowI5snl3H9wJ53OAUbtWkgxuAjkevUP8zQaONXh2s216WJKGWvnxdx2qANx02dNHmMlD5HnhWKaFoWMqCwtoxgt7Lb9+h64= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com; spf=pass smtp.mailfrom=linux.ibm.com; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b=ff0Rzr9e; arc=none smtp.client-ip=148.163.156.1 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="ff0Rzr9e" Received: from pps.filterd (m0356517.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 64EJ6tgk3950847; Fri, 15 May 2026 10:10:04 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pp1; bh=lw6VQs iKGGAYjv64P1XYGHsZlZ7C8+9vWAnC1yqX7oY=; b=ff0Rzr9eGBDo05ZVo1Nzhz 1FrSl/nCT9ec991i1Ufu99RKw6NPG7PYUYJ72WrNzaAs9G6rk8V+QthsDrVjifUj LkF2lZMSKX/uOU9kMxjOT9lirRI0XyMkZ3HBJY7LZVrWBdRlhmE4uNeSKDyvOvFF i3rziXGO78V9DW0xLmuCk55a8M+CTH0EucRTqRvdAO11ddb7wDJIWuFIpXt6pe0P tBCo3h/mKOPds1VNPB/u4oHesWqnK3t9j3n5MBBZ7aJz7GSoYMp1t2RSIboANMGu FQ60f1IRGPeVPBVFK7B7Y28qcC0mYtOoJS7ZVO6m4pKtLHmPIO4jCrbnm2ZrdaMQ == Received: from ppma21.wdc07v.mail.ibm.com (5b.69.3da9.ip4.static.sl-reverse.com [169.61.105.91]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4e5m8yagd1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 15 May 2026 10:10:03 +0000 (GMT) Received: from pps.filterd (ppma21.wdc07v.mail.ibm.com [127.0.0.1]) by ppma21.wdc07v.mail.ibm.com (8.18.1.7/8.18.1.7) with ESMTP id 64FA96ia007216; Fri, 15 May 2026 10:10:02 GMT Received: from smtprelay04.fra02v.mail.ibm.com ([9.218.2.228]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4e5kvcts7s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 15 May 2026 10:10:02 +0000 (GMT) Received: from smtpav02.fra02v.mail.ibm.com (smtpav02.fra02v.mail.ibm.com [10.20.54.101]) by smtprelay04.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 64FAA02v14221622 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 15 May 2026 10:10:00 GMT Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 629D52006B; Fri, 15 May 2026 10:10:00 +0000 (GMT) Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8E1B320067; Fri, 15 May 2026 10:09:56 +0000 (GMT) Received: from [9.124.209.124] (unknown [9.124.209.124]) by smtpav02.fra02v.mail.ibm.com (Postfix) with ESMTP; Fri, 15 May 2026 10:09:56 +0000 (GMT) Message-ID: Date: Fri, 15 May 2026 15:39:55 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 4/5] sched/fair: Reject misfit pulls onto busy SMT siblings on asym-capacity To: Andrea Righi Cc: Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , K Prateek Nayak , Christian Loehle , Phil Auld , Koba Ko , Felix Abecassis , Balbir Singh , Joel Fernandes , linux-kernel@vger.kernel.org, Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot References: <20260509180955.1840064-1-arighi@nvidia.com> <20260509180955.1840064-5-arighi@nvidia.com> From: Shrikanth Hegde Content-Language: en-US In-Reply-To: <20260509180955.1840064-5-arighi@nvidia.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-Reinject: loops=2 maxloops=12 X-Proofpoint-GUID: e4NnTNZr0GdOcTMC0mxYfg822S25o-ZK X-Authority-Analysis: v=2.4 cv=Os5/DS/t c=1 sm=1 tr=0 ts=6a06f0fc cx=c_pps a=GFwsV6G8L6GxiO2Y/PsHdQ==:117 a=GFwsV6G8L6GxiO2Y/PsHdQ==:17 a=IkcTkHD0fZMA:10 a=NGcC8JguVDcA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=U7nrCbtTmkRpXpFmAIza:22 a=KKAkSRfTAAAA:8 a=7CQSdrXTAAAA:8 a=Ikd4Dj_1AAAA:8 a=zd2uoN0lAAAA:8 a=kmGLpNlozeu1vXu6MH0A:9 a=QEXdDO2ut3YA:10 a=cvBusfyB2V15izCimMoJ:22 a=a-qgeE7W1pNrGK8U0ZQC:22 X-Proofpoint-ORIG-GUID: UppXkqS2OGR4g3kddip1gXz9pgaZns29 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNTE1MDEwMSBTYWx0ZWRfX+7S+PnNqU8IW YD2IScjzdwlAolNnWlkC+nRAW76GoBvj6hfsPCdp/2I+PXZitvth9Rz/qTzuZl/QUWtooPg+fl/ fND+GQZF+TbhE67n6JZeHBg9gQIHKMOdtSYOQm8Jq/6xe9aE0TZznODw1jZkfMt0H4EasEBqX6P 7gQVB/crqnfiQ5/HhtLCZ68KQXgT+vdh+G73K6pUhcucAwHGBUfYufKVyZOLKlKFOQBmF52psHC odfKUWOiNdVK6GWcB2gQx6BW57/PE5H9DVbvw2sXVpzKSE29f9n37tnZ+BqcmcZ01G6O2X+1NkW REul5adApYHnVOHAV1n748rKljED+Ncw7BC8Wo/yUM7Q9Ip5iX/59jsKLdWdPiQ4GcAdsE+sEU/ n1I5Bn8G0yZvdBKgG89QiZnx7T+hyfLJo2g9+y/hvsgbCNDBdFp5RgZcA3s6iyZu74TnkGLcRnW PBTjFdQ3ZcwzYtBocWA== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-05-15_02,2026-05-13_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 phishscore=0 impostorscore=0 clxscore=1015 lowpriorityscore=0 adultscore=0 malwarescore=0 priorityscore=1501 bulkscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2605130000 definitions=main-2605150101 On 5/9/26 11:37 PM, Andrea Righi wrote: > When SD_ASYM_CPUCAPACITY load balancing considers pulling a misfit task, > capacity_of(dst_cpu) can overstate available compute if the SMT sibling is > busy: the core does not deliver its full nominal capacity. > > If SMT is active and dst_cpu is not on a fully idle core, skip this > destination so we do not migrate a misfit expecting a capacity upgrade we > cannot actually provide. > > Cc: Vincent Guittot > Cc: Dietmar Eggemann > Cc: Christian Loehle > Cc: Koba Ko > Cc: K Prateek Nayak > Reported-by: Felix Abecassis > Signed-off-by: Andrea Righi > --- > kernel/sched/fair.c | 11 ++++++++++- > 1 file changed, 10 insertions(+), 1 deletion(-) > > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > index 6f0835c15ee11..2ddba8bd27e59 100644 > --- a/kernel/sched/fair.c > +++ b/kernel/sched/fair.c > @@ -9693,6 +9693,7 @@ struct lb_env { > > int dst_cpu; > struct rq *dst_rq; > + bool dst_core_idle; > > struct cpumask *dst_grpmask; > int new_dst_cpu; > @@ -10918,10 +10919,16 @@ static bool update_sd_pick_busiest(struct lb_env *env, > * We can use max_capacity here as reduction in capacity on some > * CPUs in the group should either be possible to resolve > * internally or be covered by avg_load imbalance (eventually). > + * > + * When SMT is active, only pull a misfit to dst_cpu if it is on a > + * fully idle core; otherwise the effective capacity of the core is > + * reduced and we may not actually provide more capacity than the > + * source. > */ > if ((env->sd->flags & SD_ASYM_CPUCAPACITY) && > (sgs->group_type == group_misfit_task) && > - (!capacity_greater(capacity_of(env->dst_cpu), sg->sgc->max_capacity) || > + (!env->dst_core_idle || > + !capacity_greater(capacity_of(env->dst_cpu), sg->sgc->max_capacity) || > sds->local_stat.group_type != group_has_spare)) > return false; > > @@ -11485,6 +11492,8 @@ static inline void update_sd_lb_stats(struct lb_env *env, struct sd_lb_stats *sd > unsigned long sum_util = 0; > bool sg_overloaded = 0, sg_overutilized = 0; > > + env->dst_core_idle = !sched_smt_active() || is_core_idle(env->dst_cpu); > + > do { > struct sg_lb_stats *sgs = &tmp_sgs; > int local_group; This is kind of similar to what ASYM_PACKING would have done at MC domain with equal CPU capacities. i.e pull the load if the core is idle. In your table in the cover-letter, if you do "NO ASYM + SIS_UTIL + ASYM_PACKING (at MC)" does it achieve close to "ASYM + SMT + SIS_UTIL"?