From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from stravinsky.debian.org (stravinsky.debian.org [82.195.75.108]) (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 6A16C3016F7 for ; Fri, 3 Jul 2026 16:20:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=82.195.75.108 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783095607; cv=none; b=pV85M4A3ytrhBb8xR+JtYbq0am5WO4omlSP04jUsM7d17CACawFNYiZIl0rrm36YhMn1jb35LDN0q89Jpo2GtLnk7DQmYHZktYC//kR3ZATDNO7+zlr5CG2UJJl69UCwGO+7yNYn9f9RIvHGtRKvsTpCTOK/RUnwDuVyOju7TXo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783095607; c=relaxed/simple; bh=GWaMHJgbO6tgMZucLWJ/wL9vTESxiTN3YqCXDgV2nd4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=DrPwUjct7zEPB2xl9AGj36RS2mdbgblH1hyOmansTsV9bq8lWTu7KeCN/Aj5dDmLp+SLlw9s3x8fcu0O1Hd6on+HqbKpYghixElvGytHKEvnbT1djCIgQ0h0/W0S6FclCNGGae8fYw7mpWfM2cVW44topoTp/3CKysRXaNE6dN8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=debian.org; spf=pass smtp.mailfrom=debian.org; dkim=pass (2048-bit key) header.d=debian.org header.i=@debian.org header.b=rvgvVGuz; arc=none smtp.client-ip=82.195.75.108 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=debian.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=debian.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=debian.org header.i=@debian.org header.b="rvgvVGuz" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debian.org; s=smtpauto.stravinsky; h=X-Debian-User:In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=V5+VIiBfJXx3RNjBdSVIiEL6mU19+I6priBE9FMle1E=; b=rvgvVGuzD8OZNPYPJB4FccI9GF kH/1MmjCP60saX6h27OlnuEfHvb7iA9rLsI3ZVlpyp0NYx5iWzmajqcbFFwPTDosHlFRtmSvO73AX d3kDfKKbFi6BOuc9XPBOFyc0Po94p6Ew0d+ZOjt/tejrO+vMeWOiefxxXizOXXFVw2DOuqNO8dBTm RfEe3t/8t5WyepkAMbiNlUAM4jsA6y0+YB+iSzQj5DGwqOuFoGad8VBz/WzWp0/txTTt9g0GEdS6f JFzE0ljbsRLfzdeBrvz4LAfxi5ifWSvNQAWoTG2ylqsqVxKDQy+OmBRcgI/mCsSySiILIVNRZP7mU VGOY5UUg==; Received: from authenticated-user by stravinsky.debian.org with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.96) (envelope-from ) id 1wfgcG-009WYR-2g; Fri, 03 Jul 2026 16:19:49 +0000 Date: Fri, 3 Jul 2026 09:19:42 -0700 From: Breno Leitao To: K Prateek Nayak Cc: Andrea Righi , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , Christian Loehle , Phil Auld , Koba Ko , Felix Abecassis , Balbir Singh , Joel Fernandes , Shrikanth Hegde , linux-kernel@vger.kernel.org Subject: Re: kmemleak: sched_domain_shared leaked on asymmetric-capacity + SCHED_CACHE Message-ID: References: <20260509180955.1840064-1-arighi@nvidia.com> <20260509180955.1840064-3-arighi@nvidia.com> <73685ae1-6d90-4799-a1d7-08a1fcf24b8b@amd.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <73685ae1-6d90-4799-a1d7-08a1fcf24b8b@amd.com> X-Debian-User: leitao Hello Prateek, On Fri, Jul 03, 2026 at 04:05:59PM +0530, K Prateek Nayak wrote: > On 7/3/2026 3:52 PM, Breno Leitao wrote: > > On current linux-next (CONFIG_SCHED_CACHE=y) we hit a kmemleak on an > > arm64 box with asymmetric CPU capacity, triggered by a cpuset-driven > > sched-domain rebuild: > > > > kmemleak: unreferenced object 0xffff000100c95e80 (size 32): > > comm "kworker/22:1", pid 407, jiffies 4294669077 > > hex dump (first 32 bytes): > > 48 00 00 00 48 00 00 00 00 00 00 00 20 00 00 00 H...H....... ... > > backtrace (crc ec5d7053): > > __kmalloc_cache_node_noprof > > build_sched_domains > > partition_sched_domains > > rebuild_sched_domains_locked > > rebuild_sched_domains > > process_scheduled_works > > kthread > > ret_from_fork > > kmemleak: 1 new suspected memory leaks > > > > The leaked object is a struct sched_domain_shared (32 bytes with > > CONFIG_SCHED_CACHE) allocated in __sds_alloc(), inlined into > > build_sched_domains() > > > > Is this a known issue? > > It is theoretically possible but there is a defensive WARN_ON() > in topology code that you should have hit first. Do you see any > other warning? > > If it is not too much trouble, could you add "sched_verbose" > to your kernel cmdline (or do > echo Y > /sys/kernel/debug/sched/verbose) and redo this cpuset > that leaks the data and share the dmesg. It should give some clue > what the topology looks like that causes this. Sure, does this one help: bash-5.1# cat /sys/kernel/debug/kmemleak unreferenced object 0xffff0000c1180820 (size 32): comm "swapper/0", pid 1, jiffies 4294667323 hex dump (first 32 bytes): 08 00 00 00 08 00 00 00 00 00 00 00 20 00 00 00 ............ ... 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace (crc f4478cb7): kmemleak_alloc+0x44/0xd8 __kmalloc_cache_node_noprof+0x344/0x5d8 build_sched_domains+0x2f8/0x2110 sched_init_domains+0xec/0x160 sched_init_smp+0x48/0x108 kernel_init_freeable+0x140/0x200 kernel_init+0x30/0x170 ret_from_fork+0x10/0x20 bash-5.1# cd /sys/kernel/debug/sched/domains/ bash-5.1# grep . -r * cpu0/domain0/level:1 cpu0/domain0/flags:SD_BALANCE_NEWIDLE SD_BALANCE_EXEC SD_BALANCE_FORK SD_WAKE_AFFINE SD_ASYM_CPUCAPACITY SD_ASYM_CPUCAPACITY_FULL SD_SHARE_LLC SD_PREFER_SIBLING cpu0/domain0/name:MC cpu0/domain0/cache_nice_tries:1 cpu0/domain0/imbalance_pct:117 cpu0/domain0/busy_factor:16 cpu0/domain0/max_newidle_lb_cost:2127 cpu0/domain0/max_interval:16 cpu0/domain0/min_interval:8 cpu1/domain0/level:1 cpu1/domain0/flags:SD_BALANCE_NEWIDLE SD_BALANCE_EXEC SD_BALANCE_FORK SD_WAKE_AFFINE SD_ASYM_CPUCAPACITY SD_ASYM_CPUCAPACITY_FULL SD_SHARE_LLC SD_PREFER_SIBLING cpu1/domain0/name:MC cpu1/domain0/cache_nice_tries:1 cpu1/domain0/imbalance_pct:117 cpu1/domain0/busy_factor:16 cpu1/domain0/max_newidle_lb_cost:18112 cpu1/domain0/max_interval:16 cpu1/domain0/min_interval:8 cpu2/domain0/level:1 cpu2/domain0/flags:SD_BALANCE_NEWIDLE SD_BALANCE_EXEC SD_BALANCE_FORK SD_WAKE_AFFINE SD_ASYM_CPUCAPACITY SD_ASYM_CPUCAPACITY_FULL SD_SHARE_LLC SD_PREFER_SIBLING cpu2/domain0/name:MC cpu2/domain0/cache_nice_tries:1 cpu2/domain0/imbalance_pct:117 cpu2/domain0/busy_factor:16 cpu2/domain0/max_newidle_lb_cost:3147 cpu2/domain0/max_interval:16 cpu2/domain0/min_interval:8 cpu3/domain0/level:1 cpu3/domain0/flags:SD_BALANCE_NEWIDLE SD_BALANCE_EXEC SD_BALANCE_FORK SD_WAKE_AFFINE SD_ASYM_CPUCAPACITY SD_ASYM_CPUCAPACITY_FULL SD_SHARE_LLC SD_PREFER_SIBLING cpu3/domain0/name:MC cpu3/domain0/cache_nice_tries:1 cpu3/domain0/imbalance_pct:117 cpu3/domain0/busy_factor:16 cpu3/domain0/max_newidle_lb_cost:16399 cpu3/domain0/max_interval:16 cpu3/domain0/min_interval:8 cpu4/domain0/level:1 cpu4/domain0/flags:SD_BALANCE_NEWIDLE SD_BALANCE_EXEC SD_BALANCE_FORK SD_WAKE_AFFINE SD_ASYM_CPUCAPACITY SD_ASYM_CPUCAPACITY_FULL SD_SHARE_LLC SD_PREFER_SIBLING cpu4/domain0/name:MC cpu4/domain0/cache_nice_tries:1 cpu4/domain0/imbalance_pct:117 cpu4/domain0/busy_factor:16 cpu4/domain0/max_newidle_lb_cost:27180 cpu4/domain0/max_interval:16 cpu4/domain0/min_interval:8 cpu5/domain0/level:1 cpu5/domain0/flags:SD_BALANCE_NEWIDLE SD_BALANCE_EXEC SD_BALANCE_FORK SD_WAKE_AFFINE SD_ASYM_CPUCAPACITY SD_ASYM_CPUCAPACITY_FULL SD_SHARE_LLC SD_PREFER_SIBLING cpu5/domain0/name:MC cpu5/domain0/cache_nice_tries:1 cpu5/domain0/imbalance_pct:117 cpu5/domain0/busy_factor:16 cpu5/domain0/max_newidle_lb_cost:18384 cpu5/domain0/max_interval:16 cpu5/domain0/min_interval:8 cpu6/domain0/level:1 cpu6/domain0/flags:SD_BALANCE_NEWIDLE SD_BALANCE_EXEC SD_BALANCE_FORK SD_WAKE_AFFINE SD_ASYM_CPUCAPACITY SD_ASYM_CPUCAPACITY_FULL SD_SHARE_LLC SD_PREFER_SIBLING cpu6/domain0/name:MC cpu6/domain0/cache_nice_tries:1 cpu6/domain0/imbalance_pct:117 cpu6/domain0/busy_factor:16 cpu6/domain0/max_newidle_lb_cost:16261 cpu6/domain0/max_interval:16 cpu6/domain0/min_interval:8 cpu7/domain0/level:1 cpu7/domain0/flags:SD_BALANCE_NEWIDLE SD_BALANCE_EXEC SD_BALANCE_FORK SD_WAKE_AFFINE SD_ASYM_CPUCAPACITY SD_ASYM_CPUCAPACITY_FULL SD_SHARE_LLC SD_PREFER_SIBLING cpu7/domain0/name:MC cpu7/domain0/cache_nice_tries:1 cpu7/domain0/imbalance_pct:117 cpu7/domain0/busy_factor:16 cpu7/domain0/max_newidle_lb_cost:7780 cpu7/domain0/max_interval:16 cpu7/domain0/min_interval:8