From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from BYAPR05CU005.outbound.protection.outlook.com (mail-westusazon11010031.outbound.protection.outlook.com [52.101.85.31]) (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 BBD572E0938 for ; Tue, 7 Jul 2026 04:11:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.85.31 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783397501; cv=fail; b=dcEkFCbNtAWN30dFUnMii2V3lEw68TgEJaSFE6aOekHfXORrZ+Wdvw8ZFoz6JwXqqpBi9erhWJ6jU/E+pUK5goq4C41FjjgPQy6/PyiEVe/2xRZBfJ/bSP5c2D6WZMjrKNmNbQNms8Z1zpKcScpURXd9QDaxks+872gIW1EYzz8= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783397501; c=relaxed/simple; bh=oT/FBwr02a+rZfTEqPzrjQl1vuNZgIVFAVpH0IETh2I=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=kpyi+GIWrCZJOOxkuhl+NneCwziXoNxhMJx9x4xDA2IDYwuojWEXBObjOYWSbnxrLj1AGMcsmhGud6UNvVGZ8j89THBvNWUfKW3Rq4Wnv5wIFauBdhR05A5GNmJ4LoeiFXw70rPI+UdvznOB50yqodqtGy8Iy5MjjCH6tAnAUzQ= 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=UPVdN8cN; arc=fail smtp.client-ip=52.101.85.31 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="UPVdN8cN" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=cXaJoTo5Ie/XD2hWij6f4nJ2jlmpap4/YyPk5D85n/a41LkIu1ci656lJii1J8WzVoxt3tOseECd2yjYr8MClf26moBzh8WOC+MpZC0RvLnfRih3MRsDVvCzV6Jwn89EPGyws90KxwSIex202O+Vc9EzpfgwAn5oQYFMYXrSnfq4mIH+RNqyrQ2W1MA7bCUQy7UrBYfAzo0uP+NvKXTaGVhu7tAbCJ3lbbcYsdOe74gRDusGL7bBSZFZw5ZeomzS+B4xaj6RN46WDgTFp6eyFv+uzULLJfyZlNtXftPCksmcAqXMEvojR+3LgK7hW82wktcWbMKHpq6Y7Ur4XM9ogQ== 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=InnEgwO2I643G1VyhRvu+/jNV+QI4QPCu6eAgEtr8M4=; b=abRCpL3UY8UUbc0GuKf1sP9bm8ETrLe9CYyFDfDWNdGuhkq6h0xrlgh8454SUXTdoUsSY+4llvwSQXtOuSyysmX4QmuFxIr19evIPrNa1Nk38VN0GJzNrZUiQNGdOMLPlQYzObH5/puVAvOsSPzx42fgPo9cUldo7mlhCNOP0g7PHU74YNeSwsU1SnKlFwka368FMwQY5MZTHICy+K2mNZIhpkRWr6/GGjJdAxrgpVYUbWZKD2xo3pFx+KqKoYjRJgwXBf7ZZc7qa7q2J7u7EU3dFFyRQVuyJVk5MyRouK4bC4xNru3adMYBXKV+lyCeSgxfXqFmYq10NeKVBf9M+Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=arm.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=InnEgwO2I643G1VyhRvu+/jNV+QI4QPCu6eAgEtr8M4=; b=UPVdN8cNZMUcnm5b4N5UxgNuzFFJxVhlHdoHjco/gIgMtEyW7FK1+PRsavYBHS+hRYZP4ijtNbRxU+SQzJAjfmRceDvC8QSRn0n7vyAkGcM1kXxpb9ABOuNpHXi0rNHqg/z/90pqnISErES2/03C/a9k+zWIqAmtYaFCcNe3fjE= Received: from SN7PR04CA0050.namprd04.prod.outlook.com (2603:10b6:806:120::25) by DS4PR12MB9585.namprd12.prod.outlook.com (2603:10b6:8:27e::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.159.18; Tue, 7 Jul 2026 04:11:35 +0000 Received: from SN1PEPF00026367.namprd02.prod.outlook.com (2603:10b6:806:120:cafe::9b) by SN7PR04CA0050.outlook.office365.com (2603:10b6:806:120::25) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.181.13 via Frontend Transport; Tue, 7 Jul 2026 04:11:35 +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=satlexmb08.amd.com; pr=C Received: from satlexmb08.amd.com (165.204.84.17) by SN1PEPF00026367.mail.protection.outlook.com (10.167.241.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.6 via Frontend Transport; Tue, 7 Jul 2026 04:11:35 +0000 Received: from satlexmb10.amd.com (10.181.42.219) by satlexmb08.amd.com (10.181.42.217) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Mon, 6 Jul 2026 23:11:34 -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.41; Mon, 6 Jul 2026 23:11:34 -0500 Received: from [10.85.38.115] (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server id 15.2.2562.41 via Frontend Transport; Mon, 6 Jul 2026 23:11:30 -0500 Message-ID: Date: Tue, 7 Jul 2026 09:41:29 +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: kmemleak: sched_domain_shared leaked on asymmetric-capacity + SCHED_CACHE To: Dietmar Eggemann , Breno Leitao CC: Andrea Righi , Ingo Molnar , "Peter Zijlstra" , Juri Lelli , "Vincent Guittot" , Steven Rostedt , Ben Segall , Mel Gorman , "Valentin Schneider" , Christian Loehle , Phil Auld , Koba Ko , Felix Abecassis , Balbir Singh , Joel Fernandes , Shrikanth Hegde , References: <20260509180955.1840064-1-arighi@nvidia.com> <20260509180955.1840064-3-arighi@nvidia.com> <73685ae1-6d90-4799-a1d7-08a1fcf24b8b@amd.com> <73697ae3-f826-4b0e-be05-446976223822@amd.com> <9476c607-92bd-4f98-b9a0-c9ca559c9d91@arm.com> Content-Language: en-US From: K Prateek Nayak In-Reply-To: <9476c607-92bd-4f98-b9a0-c9ca559c9d91@arm.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF00026367:EE_|DS4PR12MB9585:EE_ X-MS-Office365-Filtering-Correlation-Id: d00491ad-789c-4952-4a7d-08dedbddd5ae X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|36860700016|82310400026|23010399003|7416014|22082099003|18002099003|56012099006|5023799004|4143699003|6133799003|11063799006; X-Microsoft-Antispam-Message-Info: A70xmRtVmah+Aei+eFv72GjSbitff8tOeNnlT0lLXW80NWYSPut1IgrBxrOpIaBAt7I4iS8G6XeeaGINW3YOhx3+LIl9ps00Yoc1OluyQ/3BvgazXtgG+YRUvbWw0taNxy2PJv/hFwkXlx9Y0ekyOiLHfj3kg488avqVgPh1+Auh2jcVb7zMsaCVCh2OS9lG6EPOIVwv/YPXM79Ip/wSIy/xmUk5mW1W3Bj7YBHwiKXdkQDQrH3FGoYjMQPAdhxwblDJNvLKcLL34dHfPnshH/YDdh1wT4JMmUF9dkpnmFYSnKSnBTNrMm6Kv/U/xO6GVzbcVqvsZsAUhwNpvIFe/dpFD3gJJI92jS/SQU70k9w3hnRXHVIXF90zDMQkYHiqkBz+YbD0mTiZ4XDAPZDCupRXm13Rx2oUuBEiwIJWOxo+9qTp7QNWFed+ibnUCycCOcsunZ84SgttXYfQT1pwcWdU17gD90mgC9BEzoQEi7XAGGeK9Aey1UQAcNOQCD9jbvzU/o8a+vV39Bx4ovhvSu5jKKb6/N0FvVDkF4aERo0wrgbkQ76HFrqufNvTnxPcyiwlidm10szTD11oOQ/rxOuLPAYLVBjJZpbt6sGl4Ys9X9cRsieRUjTltPGdSIWylEY6ZWayqAu3u1rjdErvXPYrf0giMdUlgoUe2dYm5aj7nwOavOt3u0Lq7ZpKBIGKH1iKrI5HUF5g1kHdtSz48g== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb08.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(376014)(36860700016)(82310400026)(23010399003)(7416014)(22082099003)(18002099003)(56012099006)(5023799004)(4143699003)(6133799003)(11063799006);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 7GVG3rS6ey6tPCouX0Py4LMPAR+IsntKr6Y4Dc3LzyrkxSn9F1KppbRDSdMNVU5CNoL6OsDr7zwvjYcExjsi1/zgg6hhPCz7rqRi1dcv90Ggra8cX6VBUtsxmZ7kBbMrK0cyvye53h9AI8aw8UNi463OwHXzn30nhJF8T01qDZ4R6OKDEBlxYLS9GZ0psHMDFxpcqqqKuZE62NRUMgS1eTYuLoBDen+b1pLptNzUQzfPVTVOWYs70FWEtQoKusQxSs8jTONyUE/jScjIKV28Ts7ofIhVyto7N94ICl7oz8ENdf7IxBYM9ZIl02A4eTy4YhisXLn9Tum2D7gRNVUfZ4RA/r+8To6yENkldS0vPpHwGtL8j4Wp4eudpkEjTDFORUV7QLk8r7lNsdon9IB6zCuroJDA5QaNswuHvHtAdTvZHzCfnqheuks2RFNi+bZ6 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2026 04:11:35.1853 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d00491ad-789c-4952-4a7d-08dedbddd5ae 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=[satlexmb08.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF00026367.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS4PR12MB9585 Hello Dietmar, Breno, On 7/6/2026 8:08 PM, Dietmar Eggemann wrote: >> Is this the defualt topology before the cpuset? Because >> min_interval of 8 means there are 8 cPUs in the span and >> you have 8 CPUs in your machine so there seems to be a >> single root partition when you captured this. > > +1 > >> Also does your dmesg have any warnings from topology.c? >> >> The only way I can see this triggering is there is a single >> cpu SD_SHARE_LLC at top which claims all the sd->shared and >> then you get a SD_ASYM_CPUCAPACITY_FULL on top which too >> tries to claim a sd->shared but all are already gone. > > ? I may have found what might be happening. Since the last SD_SHARE_LLC and the first SD_ASYM_CPUCAPACITY_FULL overlap, init_sched_domain_shared() for SD_SHARE_LLC might just be overwriting the assignment from claim_asym_sched_domain_shared() and we are left with a non-zero refcounted shared that evades claim_allocations() but is not used anywhere either. Breno, could you try the below diff: (Only build tested) diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c index 622e2e01974c..07e5a2c08132 100644 --- a/kernel/sched/topology.c +++ b/kernel/sched/topology.c @@ -2942,6 +2942,16 @@ init_sched_domain_shared(struct s_data *d, struct sched_domain *sd, int flags) struct sched_domain_shared *sds = NULL; int cpu; + /* + * If sd->shared is already assigned, there is an overlap in the + * flags (For example: last SD_SHARE_LLC domain, is also the + * first SD_ASYM_CPUCAPACITY_FULL domain). + * + * Return early to prevent overriding the sd->shared already + * assigned which can lead to dangling reference. + */ + if (sd->shared) + return; /* * Multiple domains can try to claim a shared object like * SD_ASYM_CPUCAPACITY and SD_SHARE_LLC which can alias to --- It is prepared on top of tip:sched/core but should apply cleanly on any tree after v7.2-rc1 since nothing else has changed in these parts since the merge window. -- Thanks and Regards, Prateek