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 38F053769FA for ; Tue, 30 Jun 2026 15:27:27 +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=1782833250; cv=none; b=Uwc8Jnxlj18fMnS2ZWYjmNqL18Z5kgqkzrnU7JFtv5cB4EuUNTKTSm2sl7eMBR4mWqjlrPTvkGmArOkETc+WyID3kP8Qnz7w46d62hWh6RA5KIfUv3Pnx9di8JQPc9/L4cU0Fo9B8BuQY34Ld5t71SqAwjxDwsD4Hpxc7/tuiaM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782833250; c=relaxed/simple; bh=bqY9/FD+SFdpA+iZEIeadSnbTIK2eXJ5fOqFXcgJf4U=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=RvsGcDi5mg44P09CFEOXpcTP4o1n3ZQogbxOJjJb1CJnl8X5YSsFj2H52PMz54/CJYeGYgh8fT39zMerC6qq8Sy6joxuQ8D62QcnepKeYo5dsaQLO6rfEsQDlvqvGaVlRDjR+zSh+9CkD8P9Vc2LIPrMnv4ontNljmTiYNJfOns= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=k7aOivSE; 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="k7aOivSE" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 27E5B1F000E9; Tue, 30 Jun 2026 15:27:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1782833247; bh=bqY9/FD+SFdpA+iZEIeadSnbTIK2eXJ5fOqFXcgJf4U=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=k7aOivSEBgq6tZRBRw3RtgeEr4RL4zSfJrCMvk4KTmvsrf+2CelqCFSaNkXHys8Sf r5KS3Vk4hMBeK4+q5c1IuFesi+wmICd2Yo7Hir3L6/B+WfrUl4TIeJWSLvP1jSu2/7 PRu9hNtJBgUTJIykXG8Vse/XPcyw/rEuSdNzlXFfgIkYy7CsSZ5x+6Eg9yfFzJYLdS mTeXv48HxhCmPeaP3O7BYszLn6knqxn3x51AioyVsZYLuTQpcPn3pDLNbDZOXnTwp8 TX+FaGD54QnMdnT4t2pn9wpQv7CiMVvDq4pAgIoIaonOQI9HuiIAXpW1QUaj5RlQd4 u5X/LnufgG7Aw== Message-ID: Date: Wed, 1 Jul 2026 00:27:17 +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 To: Suren Baghdasaryan , Shakeel Butt Cc: "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> Content-Language: en-US From: Harry Yoo In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------skVAWTxerAh0fKLUMQDzBRaE" This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------skVAWTxerAh0fKLUMQDzBRaE Content-Type: multipart/mixed; boundary="------------Sm6xLvjEBt7qrU3afTmO0DHi"; protected-headers="v1" From: Harry Yoo To: Suren Baghdasaryan , Shakeel Butt Cc: "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 Message-ID: Subject: Re: [PATCH] mm/slub: serve slabobj_ext array from a strictly larger kmalloc cache References: <62969830-4b1f-483d-8fa9-9ce487568570@kernel.org> <39a79576-dcae-4b66-9478-c81dfe676699@kernel.org> <5ebd3c4a-5c06-43b4-ab0a-7a8f0396c84c@kernel.org> In-Reply-To: --------------Sm6xLvjEBt7qrU3afTmO0DHi Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 6/30/26 11:52 PM, Suren Baghdasaryan wrote: > On Tue, Jun 30, 2026 at 7:36=E2=80=AFAM Shakeel Butt wrote: >> >> On Tue, Jun 30, 2026 at 04:03:30PM +0900, Harry Yoo wrote: >>> >>> >>> On 6/30/26 3:12 PM, Vlastimil Babka (SUSE) wrote: >>>> On 6/30/26 07:29, Suren Baghdasaryan wrote: >>>>> On Mon, Jun 29, 2026 at 9:42=E2=80=AFPM Harry Yoo wrote: >>>>>> >>>>>> >>>>>> >>>>>> On 6/30/26 1:39 PM, Suren Baghdasaryan wrote: >>>>>>> On Mon, Jun 29, 2026 at 9:38=E2=80=AFPM Suren Baghdasaryan wrote: >>>>>>>> >>>>>> >>>>>> Ah, here I meant backporting either the kmalloc_flags()+KMALLOC_TY= PE or >>>>>> SLAB_BUCKETS approach. >>>>>> >>>>>>>> Yes, it's worth backporting, so we can merge Shakeel's change as= is >>>>>> >>>>>> Right. >>>>>> >>>>>>>> and then once Vlastimil's patch is merged we can implement the n= ew >>>>>> >>>>>> Vlastimil's patch has already landed mainline, by the way :) >>>>> >>>>> Nice! I suggest posting Shakeel's patch CC'ing stable for backports= >>>>> and then following up with the fix using KMALLOC_TYPE. Vlastimil, >>>>> WDYT? >>>> >>>> Sounded like a plan, but then I realized I misunderstood the amount = of the >>>> wastage. E.g. on my system kmalloc-8k with 4 objects per slab would = have >>>> obj_ext size of 64, but now it's 16k? That's ridiculous. >>> >>> Right. >> >> Yeah I should have given more thought on wastage. >=20 > Ugh! I didn't realize the wastage was that high. Ouch! >>> ...which is why I was assuming either the KMALLOC_TYPE or SLAB_BUCKET= S >>> approach would be backported as a follow-up. Err, should have >>> communicated clearly, apologies. >> >> Harry, do you want to take a stab at prototyping these? If these look = simple >> enough, we can request backports of this. Ack, let's see what would be the minimal changes to resolve this. > I'll also give it some thought to see if there is maybe a different > way to fix this that would be easy to backport. Thanks, let's discuss! >>>> We could say it's for a debugging feature, but also it's running in >>>> production fleets (and Android?), so probably not that easy to dismi= ss. >>> >>> I think a key factor is when it's enabled in production. >>> >>> kconfigs says Android selects MEM_ALLOC_PROFILING, but not >>> MEM_ALLOC_PROFILING_ENABLED_BY_DEFAULT. >>> >>> I assumed that turning it on by default in the entire fleet >>> would be bit hard to justify... (please correct me, >>> if it's not the case) >> >> Actually we have memory profiling enabled by default across Meta fleet= =2E So, the >> issue is very real. I see, thanks for clarifying. >> At the moment, we are seeing this issue on a specific >> type of machine and we have disabled memory profiling for those machin= es. >> Internally we did discuss to simply disable memory allocation profilin= g for >> kmalloc-normal caches but to me that was a big hammer and thus suggest= ed the >> current approach. --=20 Cheers, Harry / Hyeonggon --------------Sm6xLvjEBt7qrU3afTmO0DHi-- --------------skVAWTxerAh0fKLUMQDzBRaE Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYKAB0WIQQQ1ub6gR5ogjaKRmOGXBN6rc5S1gUCakPgVQAKCRCGXBN6rc5S 1kRkAP0cCyz+MOuScd4bBw4i+wwekcvOlfmYceS8T/EMfZsBGAEA2SuKBS6mNz/o Zk4R3X5gR8S1OGqYJJs8lIT4me06jgQ= =3A81 -----END PGP SIGNATURE----- --------------skVAWTxerAh0fKLUMQDzBRaE--