From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from DM5PR21CU001.outbound.protection.outlook.com (mail-centralusazon11011065.outbound.protection.outlook.com [52.101.62.65]) (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 5C2DC2B2D7 for ; Tue, 23 Dec 2025 05:32:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.62.65 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766467940; cv=fail; b=Ll7IMHbVJnr2Q4xhl1t6CsAuvwXG4hPaV2m0Wgbbj8LvvIIxGkQpHOK2SVAXepYRveYtAflQT7I7VjHVIXF+joWIlYZI+ZqD08L5KUIgx7lrp+3Xc6cKZ8hQcfITtIVLDmS6hcrBz1auvCbh6yD1fg4Et2K5x8hiVO7XIxpgdIM= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766467940; c=relaxed/simple; bh=EFjKdrxVQP8SaQoBG9UkOz4R0/Dn2787YQoz3MzKPVc=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=a+yjT5B8G+kqx+eaQUCo95JunxeZABSdJmM6HwLIF/AQIzpkWbmaqUQroGIwe3PnCh4IdJJQ+zHihPr9NCcFiNTB3TRd8jIBDR+yeUWLaiUUDIgtE0mClibcEMIx+WpLA3fw2ViAonmrhHRtGvtqRKzl57nZGXgwrgsHtJbd5/A= 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=zJ+C+E+Z; arc=fail smtp.client-ip=52.101.62.65 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="zJ+C+E+Z" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=awZJSzj7zanzWXROSNZLwlM4yy4zfIgOIFHHVBUVRA0pSyxYfi30g1g7DVstOe+ogvbSblRGSxkfAulLOmYPc+lu3KrDtCIR8ebOvyRfjswbLqxcOsiLG6okY/zBaZqQogwLZwYtqIpyAP+ytEBtwwvNrhtaGQyMyu/bGmTizSo1Le9gJCMMkEDIK8sFXzuhWO859HVHr3WX+uL44+MsQZyzmrl0mo+LBZcRduQk5AyvDrmdGjyBNzn+ZUiS7OdC1vV/D2C3JtxdFtrrFK8L3X80RpdIWymqgazwbOqwptlocAE4FfU29fersDJJcNN94iv1voi+tERpPynBNx+tAA== 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=ZoWgkrrNST11gzYt/dkJJz2xfQdgqGXA7Y5QYqahebg=; b=mmphV4lpo8vLZgzrsltCxuEDP3qg7VGCT8pNF4CM7tC00pbzfEYdVXZZCE1c+FIr7I5x0iluL2SeYMAOfQMwAFgJVKCM0oQZMO7TugTo9g7XivPUPgTK2WU22diRbb75c8JJfeORpEh6oNHlNB+rPPfUaQKejvoBU7pqeal43YKF9j4D2ZfZCEjlL6K2B++f/Xy5Cg1R8XXZitorPrsvxQ0vN9hNiEMsYS3awo/4g0pOlWFFKTKfWju/CROs1X3ynpAf+S7tNPxPFLFuYSYPN8I/Wyax8DWfZel6w1KAA433slu5M6s0iqdX8+jRCYRHTWdQy1dP+el6P7DR5sxYCQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=linux.intel.com 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=ZoWgkrrNST11gzYt/dkJJz2xfQdgqGXA7Y5QYqahebg=; b=zJ+C+E+Zo8n36jgHjDdsVCBdPwUr53rMEkkUkypCq0rT+C+QH+RLHikh+tE8/njAGbJqannKchmWXLNh8/5i3CjB+/OafZ93fV6mMSm8ZnnY07G002XVsv+tJr9xoiOoSKoEu4U6/cIuqED7p/NgVtAg/K9arGCnn/ftxr/scpU= Received: from SJ0PR13CA0176.namprd13.prod.outlook.com (2603:10b6:a03:2c7::31) by SJ5PPFB332093D3.namprd12.prod.outlook.com (2603:10b6:a0f:fc02::99f) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9434.11; Tue, 23 Dec 2025 05:32:14 +0000 Received: from SJ5PEPF000001F2.namprd05.prod.outlook.com (2603:10b6:a03:2c7:cafe::9b) by SJ0PR13CA0176.outlook.office365.com (2603:10b6:a03:2c7::31) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9456.11 via Frontend Transport; Tue, 23 Dec 2025 05:32:17 +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 SJ5PEPF000001F2.mail.protection.outlook.com (10.167.242.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9456.9 via Frontend Transport; Tue, 23 Dec 2025 05:32:13 +0000 Received: from satlexmb08.amd.com (10.181.42.217) 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, 22 Dec 2025 23:31:49 -0600 Received: from [10.136.37.231] (10.180.168.240) by satlexmb08.amd.com (10.181.42.217) with Microsoft SMTP Server id 15.2.2562.17 via Frontend Transport; Mon, 22 Dec 2025 23:31:41 -0600 Message-ID: <2f9165fe-55f2-4919-be01-e9d2cdd1f960@amd.com> Date: Tue, 23 Dec 2025 11:01:40 +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 04/23] sched/cache: Make LLC id continuous To: Tim Chen , Peter Zijlstra , Ingo Molnar , "Gautham R . Shenoy" , Vincent Guittot CC: Juri Lelli , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , Madadi Vineeth Reddy , "Hillf Danton" , Shrikanth Hegde , "Jianyong Wu" , Yangyu Chen , Tingyin Duan , Vern Hao , Vern Hao , Len Brown , Aubrey Li , Zhao Liu , Chen Yu , Chen Yu , Adam Li , Aaron Lu , Tim Chen , References: 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: SJ5PEPF000001F2:EE_|SJ5PPFB332093D3:EE_ X-MS-Office365-Filtering-Correlation-Id: 6a42a969-a0a2-4353-86a6-08de41e4a0b7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|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HhMTHpOTllEL3E0?= =?utf-8?B?TElOazhldFFrbUE4M1NzZWlrSCs1WWgwaGhZWW95WHF4cnZ1L3JIMkcyS2lW?= =?utf-8?B?Qm1iR3JETUlSajJxY0hjWUlRVXpSb3dQTEQySmpnekZDYVY0NUtGTnFyL0JI?= =?utf-8?B?ank3bkwxZFJ0WlpjaXBCSGRCcG5wTUc1d1RJeW03OU03ZE1CdFlNNHhrbXY1?= =?utf-8?B?V0JqRFc5TVBRTnZmdE5raCtXOWp2V3JzcDBiTU1BWnNxbUVTNnZiaHNCbnIw?= =?utf-8?B?YnlrNCtrOTYzNWpOUS9CcXRCMVB2NC9aTGRKb1BZUWpQSkVGYmdmRVpPcWZB?= =?utf-8?B?YVdpNUMvQ1JuQXo5YzNMVlBoL25vSkRIRE94Y05rOThDS3B6THdURWd3aGRX?= =?utf-8?Q?G+FU=3D?= 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)(36860700013)(376014)(32650700017)(1800799024)(7416014)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Dec 2025 05:32:13.6832 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6a42a969-a0a2-4353-86a6-08de41e4a0b7 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: SJ5PEPF000001F2.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ5PPFB332093D3 Hello Tim, Chenyu, On 12/4/2025 4:37 AM, Tim Chen wrote: > +/* > + * Assign continuous llc id for the CPU, and return > + * the assigned llc id. > + */ > +static int update_llc_id(struct sched_domain *sd, > + int cpu) > +{ > + int id = per_cpu(sd_llc_id, cpu), i; > + > + if (id >= 0) > + return id; > + > + if (sd) { > + /* Look for any assigned id and reuse it.*/ > + for_each_cpu(i, sched_domain_span(sd)) { > + id = per_cpu(sd_llc_id, i); > + > + if (id >= 0) { > + per_cpu(sd_llc_id, cpu) = id; > + return id; > + } > + } > + } I don't really like tying this down to the sched_domain span since partition and other weirdness can cause the max_llc count to go unnecessarily high. The tl->mask() (from sched_domain_topology_level) should give the mask considering all online CPUs and not bothering about cpusets. How about something like: diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 5b17d8e3cb55..c19b1c4e6472 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -8270,6 +8270,18 @@ static void cpuset_cpu_active(void) static void cpuset_cpu_inactive(unsigned int cpu) { if (!cpuhp_tasks_frozen) { + /* + * This is necessary since offline CPUs are + * taken out of the tl->mask() and a newly + * onlined CPU in same LLC will not realize + * whether it should reuse the LLC ID owned + * by an offline CPU without knowing the + * LLC association. + * + * Safe to release the reference if this is + * the last CPU in the LLC going offline. + */ + sched_domain_free_llc_id(cpu); cpuset_update_active_cpus(); } else { num_cpus_frozen++; diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c index 41caa22e0680..1378a1cfad18 100644 --- a/kernel/sched/debug.c +++ b/kernel/sched/debug.c @@ -631,6 +631,7 @@ void update_sched_domain_debugfs(void) i++; } + debugfs_create_u32("llc_id", 0444, d_cpu, (u32 *)per_cpu_ptr(&sd_llc_id, cpu)); __cpumask_clear_cpu(cpu, sd_sysctl_cpus); } } diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index 3ceaa9dc9a9e..69fad88b57d8 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -2142,6 +2142,7 @@ extern int group_balance_cpu(struct sched_group *sg); extern void update_sched_domain_debugfs(void); extern void dirty_sched_domain_sysctl(int cpu); +void sched_domain_free_llc_id(int cpu); extern int sched_update_scaling(void); diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c index cf643a5ddedd..d6e134767f30 100644 --- a/kernel/sched/topology.c +++ b/kernel/sched/topology.c @@ -20,6 +20,46 @@ void sched_domains_mutex_unlock(void) /* Protected by sched_domains_mutex: */ static cpumask_var_t sched_domains_tmpmask; static cpumask_var_t sched_domains_tmpmask2; +static cpumask_var_t sched_llc_id_alloc_mask; +DEFINE_PER_CPU(int, sd_llc_id) = -1; +static int max_llcs = 0; + +static inline int sched_domain_alloc_llc_id(void) +{ + int llc_id; + + lockdep_assert_held(&sched_domains_mutex); + + llc_id = cpumask_first_zero(sched_llc_id_alloc_mask); + BUG_ON((unsigned int)llc_id >= nr_cpumask_bits); + cpumask_set_cpu(llc_id, sched_llc_id_alloc_mask); + ++max_llcs; + + return llc_id; +} + +void sched_domain_free_llc_id(int cpu) +{ + int i, llc_id = per_cpu(sd_llc_id, cpu); + bool found = false; + + lockdep_assert_cpus_held(); /* For cpu_active_mask. */ + guard(mutex)(&sched_domains_mutex); + + per_cpu(sd_llc_id, cpu) = -1; + for_each_cpu(i, cpu_active_mask) { + if (per_cpu(sd_llc_id, i) == llc_id) { + found = true; + break; + } + } + + /* Allow future hotplugs to claim this ID */ + if (!found) { + cpumask_clear_cpu(llc_id, sched_llc_id_alloc_mask); + --max_llcs; + } +} static int __init sched_debug_setup(char *str) { @@ -658,7 +698,6 @@ static void destroy_sched_domains(struct sched_domain *sd) */ DEFINE_PER_CPU(struct sched_domain __rcu *, sd_llc); DEFINE_PER_CPU(int, sd_llc_size); -DEFINE_PER_CPU(int, sd_llc_id); DEFINE_PER_CPU(int, sd_share_id); DEFINE_PER_CPU(struct sched_domain_shared __rcu *, sd_llc_shared); DEFINE_PER_CPU(struct sched_domain __rcu *, sd_numa); @@ -684,7 +723,6 @@ static void update_top_cache_domain(int cpu) rcu_assign_pointer(per_cpu(sd_llc, cpu), sd); per_cpu(sd_llc_size, cpu) = size; - per_cpu(sd_llc_id, cpu) = id; rcu_assign_pointer(per_cpu(sd_llc_shared, cpu), sds); sd = lowest_flag_domain(cpu, SD_CLUSTER); @@ -2567,10 +2605,35 @@ build_sched_domains(const struct cpumask *cpu_map, struct sched_domain_attr *att /* Set up domains for CPUs specified by the cpu_map: */ for_each_cpu(i, cpu_map) { - struct sched_domain_topology_level *tl; + struct sched_domain_topology_level *tl, *tl_llc = NULL; + bool done = false; sd = NULL; for_each_sd_topology(tl) { + int flags = 0; + + if (tl->sd_flags) + flags = (*tl->sd_flags)(); + + if (flags & SD_SHARE_LLC) { + tl_llc = tl; + + /* + * Entire cpu_map has been covered. We are + * traversing only to find the highest + * SD_SHARE_LLC level. + */ + if (done) + continue; + } + + /* + * Since SD_SHARE_LLC is SDF_SHARED_CHILD, we can + * safely break out if the entire cpu_map has been + * covered by a child domain. + */ + if (done) + break; sd = build_sched_domain(tl, cpu_map, attr, sd, i); @@ -2579,7 +2642,41 @@ build_sched_domains(const struct cpumask *cpu_map, struct sched_domain_attr *att if (tl == sched_domain_topology) *per_cpu_ptr(d.sd, i) = sd; if (cpumask_equal(cpu_map, sched_domain_span(sd))) - break; + done = true; + } + + /* First time visiting this CPU. Assign the llc_id. */ + if (per_cpu(sd_llc_id, i) == -1) { + int j, llc_id = -1; + + /* + * In case there are no SD_SHARE_LLC domains, + * each CPU gets its own llc_id. Find the first + * free bit on the mask and use it. + */ + if (!tl_llc) { + per_cpu(sd_llc_id, i) = sched_domain_alloc_llc_id(); + continue; + } + + /* + * Visit all the CPUs of the LLC irrespective of the + * partition constraints and find if any of them have + * a valid llc_id. + */ + for_each_cpu(j, tl_llc->mask(tl, i)) { + llc_id = per_cpu(sd_llc_id, j); + + /* Found a valid llc_id for CPU's LLC. */ + if (llc_id != -1) + break; + } + + /* Valid llc_id not found. Allocate a new one. */ + if (llc_id == -1) + llc_id = sched_domain_alloc_llc_id(); + + per_cpu(sd_llc_id, i) = llc_id; } } @@ -2759,6 +2856,7 @@ int __init sched_init_domains(const struct cpumask *cpu_map) zalloc_cpumask_var(&sched_domains_tmpmask, GFP_KERNEL); zalloc_cpumask_var(&sched_domains_tmpmask2, GFP_KERNEL); + zalloc_cpumask_var(&sched_llc_id_alloc_mask, GFP_KERNEL); zalloc_cpumask_var(&fallback_doms, GFP_KERNEL); arch_update_cpu_topology(); --- AFAICT, "sd_llc_id" isn't compared across different partitions so having the CPUs that are actually associated with same physical LLC but across different partitions sharing the same "sd_llc_id" shouldn't be a problem. Thoughts? -- Thanks and Regards, Prateek