From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 99B6FC43458 for ; Tue, 30 Jun 2026 15:27:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8952E6B00E4; Tue, 30 Jun 2026 11:27:30 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 86CC26B00FB; Tue, 30 Jun 2026 11:27:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7AABC6B00FD; Tue, 30 Jun 2026 11:27:30 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 413D76B00E4 for ; Tue, 30 Jun 2026 11:27:30 -0400 (EDT) Received: from smtpin07.hostedemail.com (lb01a-stub [10.200.18.249]) by unirelay08.hostedemail.com (Postfix) with ESMTP id B46B8140507 for ; Tue, 30 Jun 2026 15:27:29 +0000 (UTC) X-FDA: 84936958218.07.1998507 Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by imf06.hostedemail.com (Postfix) with ESMTP id 0802B180003 for ; Tue, 30 Jun 2026 15:27:27 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20260515 header.b=k7aOivSE; spf=pass (imf06.hostedemail.com: domain of harry@kernel.org designates 172.105.4.254 as permitted sender) smtp.mailfrom=harry@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; d=hostedemail.com; s=arc-20220608; cv=none; t=1782833248; b=UXJn9Zmy5QTI0v6SO2LMJ0pDPuXbc9lGY4XYgUbazoK8jigIVABxI/1g7YIX+9FRPcI2MH +gv9BLHr2k17ziZwYG+7JurO9M2KIF3/tvWHX5j7KgimFei00htRf8szehxs5n38KHAnlD I0Se7g0+0KaG3bqH+zNo3OcamU4BSRY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1782833248; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=bqY9/FD+SFdpA+iZEIeadSnbTIK2eXJ5fOqFXcgJf4U=; b=Sw4d577F84FT660QasaR2p7o9gkkl9dUyEuIYUgrEYXxXhbExHEz/utokxiw87cXKKlzW7 OwfW38L3bbrCYs8GB2cVmogeqHHVfF5VUaC1EjvFIIzZtAEIA4LtfVf5ncGiES0e7VVs4/ U3VTIsy4WBTuQRdEzWIS4bbEaUOEl2g= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20260515 header.b=k7aOivSE; spf=pass (imf06.hostedemail.com: domain of harry@kernel.org designates 172.105.4.254 as permitted sender) smtp.mailfrom=harry@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id 760DB60018; Tue, 30 Jun 2026 15:27:27 +0000 (UTC) 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 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" X-Stat-Signature: f4amcn9udkznpqe7rmuwrb463mqdzdqq X-Rspam-User: X-Rspamd-Queue-Id: 0802B180003 X-Rspamd-Server: rspam02 X-HE-Tag: 1782833247-374191 X-HE-Meta: U2FsdGVkX1/4Ae65yWcZ79XNKRNt9Hrh6+PLQVZKvDe8ZeoIdc8qV2GfGk5AyEde+toT/a/lTSnl8GRy/bp+wJW+2WLje2Wy6U8254QONs/2Fk25j4S530uRlXqyBW6tjvyhS8O1LRmoeckDZw3LubGqpkB9xASCZ4P7n9h4h0Qj/sclRDj74p2zgRUZnYVQDdAwVvqi8IKAx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LH7D+0v6Gvym2jtKCKSyj4peJNuIzb0SriYjElXaieL8Djez1MyHEImgU8fg/0rk2X37AETaWpq17zNKqPOfEaNpQWdlKDWg9FrPQ286au49NQKa6yyXn7MMDKTZx/JJTBSNQYQdwiBxSmpaR3XR5usaZyCtAkSp3JFRxQbIkwXewm+qd7pF0wsRpudWpggTkjmK15H/qI5COnJ5z3aHMSjDtaDpm9V89vU5+b31mNH+gGOVV3y6ccLhigW8Wh/hfH/Ax+0XI= Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: 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--