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 B40E8341AD6 for ; Sat, 16 May 2026 17:19:50 +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=1778951992; cv=none; b=COqJpYQb90TcVn7g7Kpx8E2ASGaRUpAwWdwkekct6k3jAhPULgGZbguaVtSeFfSlTi025j3qnSJE0TLbw/acMSkaURwaKnlPXzioG5wwON/0yxB1FR8zTeZZyJgDHVMkBarMjN3XQ1iIOpVKIvcLHnYQAM8B5nh36J45i45OFdQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778951992; c=relaxed/simple; bh=9aqd07gMeem05x1/4WXQzChTK3MePCpQ6K0xiioVwvE=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=h//gIb18me1OOTmfdLcWE4IJqJ59XgqKzdDyqfvNKoZi2sxIFQCPM7MdC850OeAGaOPF67L9+BsqZk1tQ0TR2W81/6XnWiRP8SS9c+FvZWZPHo5gletWggsBUgaTpyqhR25x2Uz/ZA3Y4x8DnjK/RSoJ5C7FyuiUUivYLMbiTqo= 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=LoDcN8kg; 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="LoDcN8kg" 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 64G46Of0070109; Sat, 16 May 2026 17:19: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=J4iUa7 XvV+pq8jZfTtoBf6+jsbaT+TnxbhELAMjtSNA=; b=LoDcN8kglfwbCYETk+BCTB t/hJdNNKDMBI9qZbUm2aPWQAz71gYQOC13FMKR123ht3XS/XozR2kvXRiHBN5WJz O0LiTv0okIUhLSQ/s5NAPa8KrM8bkdBF2FNOPHpE3m+HNsfBrlLuhTi0j8q2Qa/B /FFzDVqqQru+fLnRIPokV/kuzx04h5pVC2eS67RsOXD1p43bcXsqpoqW/WhV/ag1 ycfIuqI5oYKBKF6OdlDrOvGLGSnXmayXPJRSl7j6RSu0SyZ9dcZLvtB0jUprSLxL 0qE/2R0ED7vUi1PYCwepoSuALXGTDHejuPgkOsOmOJIGxqNDRRdKilExM3dA7Z0g == Received: from ppma23.wdc07v.mail.ibm.com (5d.69.3da9.ip4.static.sl-reverse.com [169.61.105.93]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4e6h8m9nkc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 16 May 2026 17:19:31 +0000 (GMT) Received: from pps.filterd (ppma23.wdc07v.mail.ibm.com [127.0.0.1]) by ppma23.wdc07v.mail.ibm.com (8.18.1.7/8.18.1.7) with ESMTP id 64GH9Lsm010892; Sat, 16 May 2026 17:19:30 GMT Received: from smtprelay07.fra02v.mail.ibm.com ([9.218.2.229]) by ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4e5kvcrhcq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 16 May 2026 17:19:30 +0000 (GMT) Received: from smtpav02.fra02v.mail.ibm.com (smtpav02.fra02v.mail.ibm.com [10.20.54.101]) by smtprelay07.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 64GHJSRo48562524 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 16 May 2026 17:19:28 GMT Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6576B2004B; Sat, 16 May 2026 17:19:28 +0000 (GMT) Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 50CDC20043; Sat, 16 May 2026 17:19:24 +0000 (GMT) Received: from [9.124.211.133] (unknown [9.124.211.133]) by smtpav02.fra02v.mail.ibm.com (Postfix) with ESMTP; Sat, 16 May 2026 17:19:24 +0000 (GMT) Message-ID: <4db1f755-bdb2-4ddf-961e-8e5a2f69c477@linux.ibm.com> Date: Sat, 16 May 2026 22:49:23 +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 v2 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: <20260516055850.1345932-1-arighi@nvidia.com> Content-Language: en-US From: Shrikanth Hegde In-Reply-To: <20260516055850.1345932-1-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: JVNMIra5Cuun2zEvq8ggy-e57xykkehM X-Authority-Analysis: v=2.4 cv=GYMnWwXL c=1 sm=1 tr=0 ts=6a08a724 cx=c_pps a=3Bg1Hr4SwmMryq2xdFQyZA==:117 a=3Bg1Hr4SwmMryq2xdFQyZA==:17 a=IkcTkHD0fZMA:10 a=NGcC8JguVDcA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=uAbxVGIbfxUO_5tXvNgY:22 a=zd2uoN0lAAAA:8 a=7CQSdrXTAAAA:8 a=KKAkSRfTAAAA:8 a=Ikd4Dj_1AAAA:8 a=VnNF1IyMAAAA:8 a=O-iyjWBPZepO-fQaVFsA:9 a=QEXdDO2ut3YA:10 a=a-qgeE7W1pNrGK8U0ZQC:22 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-ORIG-GUID: RHaB_M7iI0S8RadICpwpJb7IjkLE1Ytf X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNTE2MDE3MCBTYWx0ZWRfX4YIObdFHHeXd u/6PsWQ6pVHNswsTHQ2x+GOYqXkDE90inRdvJfK7TjhcDbmFyZ0np5LjRCsTNKQ6WDkK2rJPfSf G+oMmnABQ10U9ABsspktgiEFFKbP0rAAAqzJJvk/eLOwcATYG38gjcZeLokQeYxfRd720sqhJWD wBnKEzUKi99Y3+RwIhoo8185ppeobd+c6LRoFrzv+89kzlPUMKgMnBGeLTCANOI4h7NOVMrKlgh 4gOsN8Z+R/8hVH6D75yy3xuy3LbWqS/xohpctaOpvHabazxNsYUY0Mxq63ryrwsIPk8kEYvuDva 8Ipu9F+oyUSMgOix8v+5gXaDTTv/U0P+eyP8KRCmw2j/H0THO/ts6c+5nIgo1IuKCsF16+ezGtA Mq7zHVDESnEr2EykyuGcuAQ0J1gcVw/az7laPmjGuhWD9IWpSTOQWNwZHkXzn31tXh3EsCnrTu7 FzBrfcKizaIpHvdMk6w== 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-16_02,2026-05-15_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 malwarescore=0 lowpriorityscore=0 priorityscore=1501 bulkscore=0 adultscore=0 suspectscore=0 spamscore=0 clxscore=1015 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2605130000 definitions=main-2605160170 On 5/16/26 11:28 AM, 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: Dietmar Eggemann > Acked-by: Vincent Guittot > Co-developed-by: Andrea Righi > Signed-off-by: Andrea Righi > Signed-off-by: K Prateek Nayak > --- > Changes in v2: > - update comment referencing to the old sd_llc->shared->has_idle_cores > (Shrikanth Hegde) > Reviewed-by: Shrikanth Hegde