From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from DM1PR04CU001.outbound.protection.outlook.com (mail-centralusazon11010024.outbound.protection.outlook.com [52.101.61.24]) (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 6A2D91B4F0A for ; Mon, 27 Apr 2026 05:13:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.61.24 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777266806; cv=fail; b=F4a8NcJAn5oFE1vGCcUJW1x3ikeSUyay/xsEqgS6hcs4p3W02xrSv8o1dvtSpa1x2fGm8TIrsSTaa4rHV5HQ0tAIMq7x9LvoqjyaRJrl+q7FwEOhpAvnD/MYDTB6d3mYzjy5kpaHq90q4nQ4hM/8AUYgPdiUKAZrX/G8JdwHgtk= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777266806; c=relaxed/simple; bh=JdcJXl8kZ0qZX+kk9H+P0t4lEZgPFD222l/a5n7w0TI=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=mvMqkzT3DlfvSKOGil4kMHYkdx/ZcaZTCslXgwlKI7C5o6+xVY12mSIsYVpuTuwdhxxeni+nUMbV+AnFVx9uULotqzTGRRqJ7eJfexSMiOZ3oX/26kkA+mRazkOAAuzrsPk203j3uJOhI/3/ViBXIuIvkMx1dURf0aa+RXO4h7s= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=tYjeWOVo; arc=fail smtp.client-ip=52.101.61.24 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="tYjeWOVo" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ZjN3sUbX+OSZ9rsHd2SAFii2QcuJxw8MRl2e6oy39wpFouwYCxvZCmu4aZYHCp6F+DVhbxT5yVX5N8x869rpi8sdlyTLFrgizOBySvpglKCeXkP8fYbl28O07olrsBegNnFsCqHnetCXflRKl1c1S6LETsSit8pMU+erCaqX+mBqzz3ct190qJN3QTqarKEdjKsw3zxN2JOvxRXqUTTxGRLTaQQKR+/EmfImVQhwpvc+ZypcKUKyBSq1uqfQIBUlw1KfrDm0Ot5ctU2HdkTP7sNMDHsPDqwMj2TEJYPlWwEBFqq/QhJElCFm5PP40QeaG9eqU1IaALkdRNmsNaQ3dA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=I/0hmUSSgZjfBVasgdnoSpDKReLEiW+hxxO9nkwCK/I=; b=UhDKXxvSLDf6wtWQ8lqgWe850B/8IF2Z5thME7xEWzCfwMfEUlh5vCwqbc8mEAU1Fei09KHwUwEIX0lbh6U89Jd70Ma1FYRWseuXFTzO0f6rFpmpCmhySDA36XBfq+2xIoX+n7pq7pH9PJlOe/8S+JmkybEaVvO1JnzGx9JZIcrMmXmspjDfM1xAP1tmolr9Unao6RqXXpouLkrGwGVsdLbKiZCVa1jJT7qmZFmfW86EJLqvyM70kfKoIqG19pnCcPRWbOD01sJcqoDvgKSdSCSmtnMEDVN1Tcs42Reed8V/YFVtfYDn3LjoBf7BxUALBrekJOKtx8GuYUGI2BRPzw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=linaro.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=I/0hmUSSgZjfBVasgdnoSpDKReLEiW+hxxO9nkwCK/I=; b=tYjeWOVoUxE+f6Sv35Nb4chAZq+is6JZnyKp0inea+OG6XYw36b2Lv2lInSp1luFcUI7v6EgiVTfeMQMMKk/1c23TavCVM9JqsXrF8ml2CUbPg/1e0b1p6b5qDlvAzysJyNtX8DTWVwu9MIkdm+Z8mTRyRdQuA+QxSgH3K23Q/I= Received: from PH7P222CA0007.NAMP222.PROD.OUTLOOK.COM (2603:10b6:510:33a::32) by BL4PR12MB9535.namprd12.prod.outlook.com (2603:10b6:208:591::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9846.21; Mon, 27 Apr 2026 05:13:21 +0000 Received: from CY4PEPF0000EE35.namprd05.prod.outlook.com (2603:10b6:510:33a:cafe::34) by PH7P222CA0007.outlook.office365.com (2603:10b6:510:33a::32) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9846.26 via Frontend Transport; Mon, 27 Apr 2026 05:13:20 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=satlexmb07.amd.com; pr=C Received: from satlexmb07.amd.com (165.204.84.17) by CY4PEPF0000EE35.mail.protection.outlook.com (10.167.242.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9846.18 via Frontend Transport; Mon, 27 Apr 2026 05:13:20 +0000 Received: from satlexmb10.amd.com (10.181.42.219) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Mon, 27 Apr 2026 00:13:20 -0500 Received: from satlexmb07.amd.com (10.181.42.216) by satlexmb10.amd.com (10.181.42.219) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Mon, 27 Apr 2026 00:13:19 -0500 Received: from [10.136.41.76] (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server id 15.2.2562.17 via Frontend Transport; Mon, 27 Apr 2026 00:13:15 -0500 Message-ID: <44bb43b1-b033-44cd-ac98-3162af74ca1d@amd.com> Date: Mon, 27 Apr 2026 10:43:09 +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: Add SIS_UTIL support to select_idle_capacity() To: Vincent Guittot , Andrea Righi CC: Ingo Molnar , Peter Zijlstra , Juri Lelli , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , Christian Loehle , Koba Ko , Felix Abecassis , Balbir Singh , Joel Fernandes , Shrikanth Hegde , References: <20260423074135.380390-1-arighi@nvidia.com> <20260423074135.380390-5-arighi@nvidia.com> Content-Language: en-US From: K Prateek Nayak In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000EE35:EE_|BL4PR12MB9535:EE_ X-MS-Office365-Filtering-Correlation-Id: 75109090-c513-4fa0-a0ba-08dea41bb2df X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|7416014|376014|36860700016|82310400026|56012099003|22082099003|18002099003; X-Microsoft-Antispam-Message-Info: MyG7FhpsBn4ZcLxaytcLLQNZCQrrpDIHVc62nZ67IT9KLwwU4jGABEWDu6g8EEMOKRI7cPGHZpV8Khgh8uvcrhVS1tFO9SDNIbJIDC64bUw/4UUf2VIM6QIaAoq97YmujWTztlu8yZvy2cpF6vl/hxI2QYFtniXAygw7CgkkJRKd2QuVZBJ4T8vhwnM4rYBOxf0dqzFTfXy4NxPv54grm3ihDr++tRv99gJgFXk3J4ZR+0YswLM6vi8pQ8EtSfvtjtXvCo/ZcF5YFnnuF+oEnRjjLZFiOr4iEXUA6uvVidlqhmENlkcm3curTm+Hv2ukwR2qvPHb8j6ln/rT6VNYURRfx9sSJmnC7sAmeYWdd4fP99Y05hmeUcpvfFy3gLhfDqCrbV7xjfleLG91N6PFb3++jGPRqla5Nnanvb31WEP/uYmAVXv1vqXl46rlE20jDzl3XSe1u76lc1qqMMZxuMKOaTgGOrzlQKMEidM/f/53KGyyfXYNlXDfc+VsKh7OJQCFtxXys9uyAIH/ROFiCrD6Xxgz/jZK0xDC5GRZwsZzTjV/KGbCD0Ux302U6Pwk21/poQwsl/KYFhVztSnvvYDZqSJRAXJ1ACN6lmUM3jxVIQACd0BMi3llUr5d3J13mAj2eaqODxf7NNSs8xItK/HKKePBZmzak2Hsfz3RNTvr3yPsNUulO2/hcAo2LP7SFodtKxnMD7CJQoKnvy3oVyO7FscvQAP/ABYLBiVm1lYcis5wA55811z7p5mKxX5SGjh/shcGXo6m671BZ3KfxQ== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(7416014)(376014)(36860700016)(82310400026)(56012099003)(22082099003)(18002099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: mEYL3/6WvtQYEVahVCt0XddffG+aK2cT16uoZfJxNMQookExDmtz4g5YL80an1Ig51uVx+dvkV29Dg/ERrpmbJjVEAd8B5KcTpW/UuRJhF6hCo7LyT05lgTonAwsKWeOdmVuLk1RQHnK1RpyB4dJngrS5rtreWeODehkEyw1sE53MWkBeCdIq3b59C96FAfoX5o3rhGG98l1dkwu3AheJ7M2FnPrxOfBcH46iLcutxUc92wzxnjU5rdzm67526Ao19EQtNH7T0203f5Lbz7TTHfbHFfR3cwxYXgPoAS+uqM4ABZXrNgm8oHQpuxi6TITAcZS0nPNHxY37CeBydRWfyavZiEsqa2gyCPYPtUVT52EI/ZvBm/ldXUNDQFV7M7kz5ltO6S80JO/jYU6C0DzRSY2B8JMh1uGVZCOSp/63p+DmGncSiTmWZT17WLvnmfI X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Apr 2026 05:13:20.4632 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 75109090-c513-4fa0-a0ba-08dea41bb2df X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CY4PEPF0000EE35.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL4PR12MB9535 Hello Vincent, On 4/24/2026 6:02 PM, Vincent Guittot wrote: >> + if (sched_feat(SIS_UTIL) && sd->shared) { >> + /* >> + * Increment because !--nr is the condition to stop scan. >> + * >> + * Since "sd" is "sd_llc" for target CPU dereferenced in the >> + * caller, it is safe to directly dereference "sd->shared". >> + * Topology bits always ensure it assigned for "sd_llc" and it >> + * cannot disappear as long as we have a RCU protected >> + * reference to one the associated "sd" here. >> + */ >> + nr = READ_ONCE(sd->shared->nr_idle_scan) + 1; >> + /* overloaded LLC is unlikely to have idle cpu/core */ >> + if (nr == 1) >> + return -1; > > The comment below applies to select_idle_cpu but we want same behavior > for both function > If test_idle_cores is true we will not look for it whereas we don't > care about nr value when test_idle_core is true in the > for_each_cpu_wrap loop Ack but the initial "nr" based bailout in select_idle_cpu() applies even when test_idle_cores() is true too right? > > >> + } >> + >> for_each_cpu_wrap(cpu, cpus, target) { >> bool preferred_core = !prefers_idle_core || is_core_idle(cpu); >> unsigned long cpu_cap = capacity_of(cpu); >> >> + /* We have found a good enough target. Just use it. */ >> + if (--nr <= 0 && best_fits == -4) >> + return best_cpu; > > In select_idle_cpu(), we return immediatly when nr == 0 and > test_idle_cores is false but we loop on all cpus if test_idle_cores is > true until we found an idle core. In the case of > select_idle_capacity(), I agree that util_fits_cpu() add another level > but shouldn't we continue to loop even if we found a best_fits == -4 I see what you mean! We can additionally guard the bailout on "!prefers_idle_core". For the case where test_idle_cores() returns false, is stopping for a UCLAMP_MIN restricted CPU alright if SIS_UTIL bailout suggests it might not be fruitful to search further? Do you think it might trigger too many misfit balancing? > >> + >> if (!choose_idle_cpu(cpu, p)) >> continue; >> >> -- >> 2.54.0 >> -- Thanks and Regards, Prateek