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 665383D333E for ; Fri, 15 May 2026 10:05:51 +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=1778839552; cv=none; b=KDBvwzvrJtbBAuEs4NoLdBef0zamRDBsQNG74+llFvAKkQWiSsxvdyDzZg8qADc8JusXiVIyH3MoRHXD8R15+POs+AseYgSsHbXQTwcMkz6TFH+Boq/QHytsme7zoQ3B/QZP+9wjPdr6nE8Vpq5ad3LoycOwj1jqYGSvdr1edFw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778839552; c=relaxed/simple; bh=O8nr3rEN4XEavb7dVSGIIjOxVFpin4xdpDmRHBlHcWw=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=AgmxratqRyUvaX4ptpboj03vI37kCmHO5wxCoZA7ym2MpdxmeTKjCp4AMeTlC038HxEDVoIaD2LO6VANHhjwXoaA6a/eis8Sts/mZ5fU3E48pI6Ffocd6hd1VhUdtlm8VSx8UnFM5C5JUQXfal119+hgFzVJ/0wpxYE1oUErVTk= 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=oQoyLFKb; 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="oQoyLFKb" Received: from pps.filterd (m0353729.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 64EJ76Oe4090405; Fri, 15 May 2026 10:05:32 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=wfaL3U PiQ9GsQvgj0PvZ8divr2D+v32jUtlo4yeBEZI=; b=oQoyLFKbpc5kOsxkHI/3g+ MAcN4p0DJhDZlKagZtY3CyMvDBX/fWWdQD5JTmzl4E54NeRTmgOC7MoQwBkEtIQp cn09YdiibddpttsrRfMGN9BG9fLS2mAeI24ee1JwRvwbOpjlb1TRm6g5RC60dIjj xCQem0cer1HEmF6Gddby1Uoyq1HFgfpi+e6apfhEACpOUVnLBQILmBCUb5NU77ic QB7AuWzLLidOLrZ9iiWPo3Q37vaNa4iq5s5VZ1/h1fGcy93QgEwQXPFMCCX2wzM8 EWsE5gane954OSYzceQG6qHTEqRap+1pwuGFcWTNfR8xa9Bf1UM1jmxqe+aGFlNQ == Received: from ppma11.dal12v.mail.ibm.com (db.9e.1632.ip4.static.sl-reverse.com [50.22.158.219]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4e5m93tfsn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 15 May 2026 10:05:31 +0000 (GMT) Received: from pps.filterd (ppma11.dal12v.mail.ibm.com [127.0.0.1]) by ppma11.dal12v.mail.ibm.com (8.18.1.7/8.18.1.7) with ESMTP id 64F9sN6v032704; Fri, 15 May 2026 10:05:30 GMT Received: from smtprelay06.fra02v.mail.ibm.com ([9.218.2.230]) by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 4e5kvcarvb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 15 May 2026 10:05:30 +0000 (GMT) Received: from smtpav02.fra02v.mail.ibm.com (smtpav02.fra02v.mail.ibm.com [10.20.54.101]) by smtprelay06.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 64FA5TPX23593248 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 15 May 2026 10:05:29 GMT Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 065BC20067; Fri, 15 May 2026 10:05:29 +0000 (GMT) Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 29BFD2006B; Fri, 15 May 2026 10:05:25 +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:05:24 +0000 (GMT) Message-ID: Date: Fri, 15 May 2026 15:35:24 +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 2/5] sched/fair: Attach sched_domain_shared to sd_asym_cpucapacity To: Andrea Righi , K Prateek Nayak Cc: Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , 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-3-arighi@nvidia.com> From: Shrikanth Hegde Content-Language: en-US In-Reply-To: <20260509180955.1840064-3-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-ORIG-GUID: XdrD0izsBZN__1kOb3xpnc285L2cBNog X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNTE1MDA5NiBTYWx0ZWRfX5epA5Mm+f+rS nw+zC0JobQrkztsFIWOAjn+MfjNj54SNoTsCRMGEAB3KM0ebWzfAnKFSBcOeYl/oc5G1ZCOGiRl bHBvIjA4zPWf6XRu0WwR3mxSaoHFnhbhs66sGFxsQ+CUuZbRp2fMH/q97+KFMavaVVHjXDj8elG JpZT0fC+TqCcSd1ZcN56yt5s0TTCkvftEy+8lMLUJcb1zloqfjAr1/lkIS2TAN3PNjiaaZ0hjog bc8FeaBUYoJJLuwMM/iPB0CnlxPG6kNogd96dJz9m/AOAJIaSPc7Ix1cXuu4rwTAD7pL+6eZBEs yBqHOPb9ss8AtnRsq5HRqgcl3rjX6vAbb3kDg1o4PMoCfrO5afpXq2puLX1CuWsAEbC+nUTBx2o ZVG/ovmGUtZ++GOLp17Y7zEgjeVmHm7OhwaXh6ULXpQ4zfW3laTARpw7rqyNBiNwULxsTSb1Kby 5ksuo6CLCfpf0o4/tpQ== X-Authority-Analysis: v=2.4 cv=ZZEt8MVA c=1 sm=1 tr=0 ts=6a06efec cx=c_pps a=aDMHemPKRhS1OARIsFnwRA==:117 a=aDMHemPKRhS1OARIsFnwRA==:17 a=IkcTkHD0fZMA:10 a=NGcC8JguVDcA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=uAbxVGIbfxUO_5tXvNgY:22 a=zd2uoN0lAAAA:8 a=KKAkSRfTAAAA:8 a=7CQSdrXTAAAA:8 a=Ikd4Dj_1AAAA:8 a=O-iyjWBPZepO-fQaVFsA:9 a=QEXdDO2ut3YA:10 a=cvBusfyB2V15izCimMoJ:22 a=a-qgeE7W1pNrGK8U0ZQC:22 X-Proofpoint-GUID: IMlI8zf6aDjI7EIUEauprl2QMNg4gVt6 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 clxscore=1011 priorityscore=1501 malwarescore=0 bulkscore=0 impostorscore=0 phishscore=0 spamscore=0 lowpriorityscore=0 suspectscore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2605130000 definitions=main-2605150096 On 5/9/26 11:37 PM, Andrea Righi wrote: > From: K Prateek Nayak > > On asymmetric CPU capacity systems, the wakeup path uses > select_idle_capacity(), which scans the span of sd_asym_cpucapacity > rather than sd_llc. > > The has_idle_cores hint however lives on sd_llc->shared, so the > wakeup-time read of has_idle_cores operates on an LLC-scoped blob while > the actual scan/decision spans the asym domain; nr_busy_cpus also lives > in the same shared sched_domain data, but it's never used in the asym > CPU capacity scenario. > > Therefore, move the sched_domain_shared object to sd_asym_cpucapacity > whenever the CPU has a SD_ASYM_CPUCAPACITY_FULL ancestor and that > ancestor is non-overlapping (i.e., not built from SD_NUMA). In that case > the scope of has_idle_cores matches the scope of the wakeup scan. > > Fall back to attaching the shared object to sd_llc in three cases: > > 1) plain symmetric systems (no SD_ASYM_CPUCAPACITY_FULL anywhere); > > 2) CPUs in an exclusive cpuset that carves out a symmetric capacity > island: has_asym is system-wide but those CPUs have no > SD_ASYM_CPUCAPACITY_FULL ancestor in their hierarchy and follow > the symmetric LLC path in select_idle_sibling(); > > 3) exotic topologies where SD_ASYM_CPUCAPACITY_FULL lands on an > SD_NUMA-built domain. init_sched_domain_shared() keys the shared > blob off cpumask_first(span), which on overlapping NUMA domains > would alias unrelated spans onto the same blob. Keep the shared > object on the LLC there; select_idle_capacity() gracefully skips > the has_idle_cores preference when sd->shared is NULL. > > While at it, also rename the per-CPU sd_llc_shared to sd_balance_shared, > as it is no longer strictly tied to the LLC. > > Cc: Vincent Guittot > Cc: Dietmar Eggemann > Co-developed-by: Andrea Righi > Signed-off-by: Andrea Righi > Signed-off-by: K Prateek Nayak > --- > kernel/sched/fair.c | 19 ++++++--- > kernel/sched/sched.h | 2 +- > kernel/sched/topology.c | 95 +++++++++++++++++++++++++++++++++++------ > 3 files changed, 95 insertions(+), 21 deletions(-) > nit: There is comment still in fair.c still. Please fix that as well. "sd_llc->shared->has_idle_cores and enabled through update_idle_core() above."