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 B72303A3E87 for ; Wed, 1 Jul 2026 08:43:28 +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=1782895409; cv=none; b=kxPs0QKjfVTgMF4stQ7WuNnarJJ+jIuRIOtALGTUD6UL0l6PzZEt0nUdSTM3+150gQy/APLMVUj650WInq4UHcOqGMx677OpkpbXzIcBRryvMd62u/Dcp/aAtH6S3WNSFVZW0xyTA2l6gC/snYQ9P7aPLGjQ+fIRQOvijBED4GM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782895409; c=relaxed/simple; bh=Sz91/aD5HKsgZUWPcAxtfLwBmQ0XsRrAG0Qz33r9Bx4=; h=Message-ID:Date:MIME-Version:Subject:From:To:Cc:References: In-Reply-To:Content-Type; b=CKYv6DLRXnVHhZY6XZkZbgKZyKJMAAtmJyF0pLtoyrjGvu/jAqu2ngizZrqZf0/kwp0aLNKDyCvQ0dAYgvp5TAhcaXPS3lLbiAHd5VIwCoHeMAxceoPS/SjqL2XphhxJPTyrKkSa0f4TLTz5xXu6kpG5KMvSSJgBmejksAL27p8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=hcFkC3n8; 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="hcFkC3n8" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8F5C41F000E9; Wed, 1 Jul 2026 08:43:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1782895408; bh=wg0g0njCZHL6Zz09qa62R7YUBIiwi7uccWEENqLTF4c=; h=Date:Subject:From:To:Cc:References:In-Reply-To; b=hcFkC3n8AHC2UQ/5CKvA8Ur1qGVOq+ZJoimSPsg/lymsNXEw6hDCkD+1aAaKZUzbF EboLoiFXWX6RCKMMS95x5EetuT50ZUevkKpHh1q2EwciC75UP0Bv3S9UG3Zuv2aS7h AomCbO1VGjRn073SkoxHWyKd4LdBvRNa2Qt5PIUKn/UHIGlVUOVWfiR4uVnR5lRkzG 07Jc5gEi5ftmPZVEIS15RXvKVPNoT6My4N+4hJMdEF1crY5YsXQEoIbbIeBODtoOLR tjcrd/wz2PAqaQ3OAmwjn3896pSO2n8c0+gOwHz/G9kN2Ff7rQ0wARl9f9ai/IRfO6 clsd80r3SIm8g== Message-ID: <143ed5f0-67be-451d-a592-e184dd51763a@kernel.org> Date: Wed, 1 Jul 2026 17:43:23 +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> Content-Language: en-US In-Reply-To: <68e7f6cd-cf11-46b2-84a2-d512bb22dae4@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 7/1/26 4:42 PM, Harry Yoo wrote: >=20 >=20 > 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 =3D=3D KMALLOC_NORMAL, >> KMALLOC_CGROUP =3D=3D KMALLOC_NORMAL, >> or KMALLOC_RECLAIM =3D=3D KMALLOC_NORMAL. >> >> Just checking KMALLOC_NOT_NORMAL_BITS is misleading. >=20 > 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 --=20 Cheers, Harry / Hyeonggon