From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 C74233C345A for ; Wed, 1 Jul 2026 10:31:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782901873; cv=none; b=tX2P8y8t42wAGUfciQC3D17vmy6eZhZlOjMjeTlwUD8AwGPHwszwvwpTRL6SKxxjB2N5mrG9mAX4LSR2tbd6CvmfBEGPm1/gLfZwFGuYWb+5Yckthi/uIFC7GlSC+T9YGTJQvY2dDnhZFGG7XJLHa1WMkl7HQlaZXR9rZuftXGo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782901873; c=relaxed/simple; bh=78FkLfQPdQat+VUA0ky3C1rEcWg9x5iy9vIPuBfMLNY=; h=Message-ID:Date:MIME-Version:Subject:From:To:Cc:References: In-Reply-To:Content-Type; b=Nps64N3asrWZ80kt6sTWgXfX0KSgwmWKhFPC4rtHbqUPmNvcA/jS7RiWRJUzYGxtRteOcidAxmUHYD8ZsfGslUEZTQQQwkEGaYqLICL5sswy0t5tn0nqtvdbmgNexlNoXJ/z3rTxOEjibWzCP9jKcPLYN4Slg2CeKyOnIDa4z7A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Xrxzxwio; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Xrxzxwio" Received: by smtp.kernel.org (Postfix) with ESMTPSA id EA4041F000E9; Wed, 1 Jul 2026 10:31:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1782901870; bh=IIKmtqkYUA2YPobStqpa3RsIbXrHII8266gsF/EimRU=; h=Date:Subject:From:To:Cc:References:In-Reply-To; b=XrxzxwiotKv/LKfqyO2JYen1SMfZzycMIFzc6PrQHWUj4cdPFdG61fMy3SxrIc6ka 52AVDRaj8qW+Hfd4/AYmCinSP+E6FwF2bc+kgVyx6Ow2Foo87Nx3Enm1hvfOiOivf7 XiErzK7zd/RUcVw7pYUXEXXz5nF+XxPPk3yWHpRjw264i70RVFun+Tg5KMgmIX9uBM KtrpBWdogwH2ZURn5oHO6wrV02O+gwrSq96kbRvsgtqq7kXT9Kr4Tu2Jr9NUBPlh/A GcNfVi6v5E3b+HnPggY3pY4n/agpMwPDR4Ya616Z/fTDzFY+R9g2IGxaZoFtK8ZaOd w3MI17F50UOlQ== Message-ID: Date: Wed, 1 Jul 2026 19:31:05 +0900 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] mm/slub: serve slabobj_ext array from a strictly larger kmalloc cache From: Harry Yoo To: Suren Baghdasaryan Cc: Shakeel Butt , "Vlastimil Babka (SUSE)" , Andrew Morton , Roman Gushchin , Hao Li , Christoph Lameter , David Rientjes , Usama Arif , Meta kernel team , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Danielle Costantino , Kees Cook References: <62969830-4b1f-483d-8fa9-9ce487568570@kernel.org> <39a79576-dcae-4b66-9478-c81dfe676699@kernel.org> <5ebd3c4a-5c06-43b4-ab0a-7a8f0396c84c@kernel.org> <9a139365-28e6-4f1e-b35b-7f6091e9aa14@kernel.org> <92bf5e21-690e-4a77-929e-5217e0d7cb0c@kernel.org> <68e7f6cd-cf11-46b2-84a2-d512bb22dae4@kernel.org> <143ed5f0-67be-451d-a592-e184dd51763a@kernel.org> Content-Language: en-US In-Reply-To: <143ed5f0-67be-451d-a592-e184dd51763a@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 7/1/26 5:43 PM, Harry Yoo wrote: > On 7/1/26 4:42 PM, Harry Yoo wrote: >> On 7/1/26 1:53 PM, Harry Yoo wrote: >>> On 7/1/26 1:30 PM, Harry Yoo wrote: >>>> We can do that in pre-7.2 kernels, by teaching kmalloc_type() and >>>> kmalloc_slab() select the new KMALLOC_TYPE based on __GFP_NO_OBJ_EXT? >>>> >>>> e.g.) Select the new KMALLOC_TYPE when KMALLOC_NOT_NORMAL_BITS is not >>>> set AND __GFP_NO_OBJ_EXT is set. >>> >>> Uh, this is bit subtle though. >>> >>> In some cases KMALLOC_DMA == KMALLOC_NORMAL, >>> KMALLOC_CGROUP == KMALLOC_NORMAL, >>> or KMALLOC_RECLAIM == KMALLOC_NORMAL. >>> >>> Just checking KMALLOC_NOT_NORMAL_BITS is misleading. >> >> Here's a prototype for slab/for-next. Backporting it requires handling >> __GFP_NO_OBJ_EXT instead of SLAB_ALLOC_NO_RECURSE, but shouldn't be >> too difficult. Now writing changelog and going through testing... > > Now thinking about the performance implication of sheaf allocations > for kmalloc caches being served from KMALLOC_NO_RECURSE caches won't > have sheaves at all Oh, wait. I tried too hard to not introduce a new alloc_flag because we cannot add new gfp flags when backporting it. Probably it's just fine to simply reuse __GFP_NO_OBJ_EXT (because only few caches have sheaves in v6.18) to select KMALLOC_NO_RECURSE, while 7.2 can introduce a new flag. -- Cheers, Harry / Hyeonggon