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 7C1B378F2F for ; Tue, 30 Jun 2026 07:03:35 +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=1782803016; cv=none; b=YCfuIf6svRE0dh8U2jNkL1C1WvR8mIZtTEohlPDHc9wXCKE4m3cUKm+9f3mpQRiXQcSO6shFXnypBGPfImik6/fkeJ0J0QSHQh6sT7/okf8smpMN4X4Y58/UJR8HUghSJcSZgUSMDa+Q+o9CEr++M3J1btekIRU9eLqu7III06I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782803016; c=relaxed/simple; bh=BvvAxU3Xhs1Nl4+swhpYpIdDxd5Qh16KvC3SDvRrWRM=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=PYEb4CkSNyONXvXzNWV2zE4Y8Ek/MyyVg/XFE28SaokiYCSbUlUpCR6Dt+JY1B5FU3Ssazd+zV4/49BZglQ6dx/+B3XqS/uxI9ncImoJ0CyVFmgSxDL01RFBQ4rhJEXSQuJhJetnoFwRfwYHIvNGVbj1A3VQlQBPg+E1YT26bao= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=BISDlVt3; 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="BISDlVt3" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 135BF1F000E9; Tue, 30 Jun 2026 07:03:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1782803015; bh=BvvAxU3Xhs1Nl4+swhpYpIdDxd5Qh16KvC3SDvRrWRM=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=BISDlVt34tQXPrwEDT7E7/nW8oeXQPA38ljBMwE4zojQaX4JFuzucmQK0iO0qAYNy PkFD+w/IMV6+ptXpp7JjsvIsJRK6Jam9RFcv8c1C3MktexPxGLP4WVUSgoIvALH2es BKEBK4wqTpqDV3BpOhm+rhTGgSqd+DshHRZ7eJcTIefsVjgAUlz2akw+bNEd8y3UZM b8IqcdTAtC2VyfpzeOpw9InB9WioyZlOvU0NZYU0ml4JKZP6oEAaLnf96ywtMtZ0ef 0RxaqNub19UUjpfZM+eyr/cfZ6QfFVWDk2WzSnJTnAeyK6GLhGz6TSIiZPnc+9GmVF fx8e+ZDI5GwRg== Message-ID: <5ebd3c4a-5c06-43b4-ab0a-7a8f0396c84c@kernel.org> Date: Tue, 30 Jun 2026 16:03:30 +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: "Vlastimil Babka (SUSE)" , Suren Baghdasaryan Cc: Shakeel Butt , 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: <20260625230029.703750-1-shakeel.butt@linux.dev> <62453403-954c-4cf1-8924-6d38184b0810@kernel.org> <09267187-6c85-438f-8791-4cce8d07892a@kernel.org> <68122038-e8e0-47ed-82f8-cb6a23e4658e@kernel.org> <62969830-4b1f-483d-8fa9-9ce487568570@kernel.org> <39a79576-dcae-4b66-9478-c81dfe676699@kernel.org> Content-Language: en-US From: Harry Yoo In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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 w= rote: >>> >>> >>> >>> 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_TYPE = 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 new >>> >>> 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? >=20 > 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 hav= e > obj_ext size of 64, but now it's 16k? That's ridiculous. Right. =2E..which is why I was assuming either the KMALLOC_TYPE or SLAB_BUCKETS approach would be backported as a follow-up. Err, should have communicated clearly, apologies. > I think it will> even self-amplify to some extent? kmalloc-8 would have 512 objects per slab, > so its obj_ext is 8k. It will not recursively create an obj_ext for the= > obj_ext, but other 8k allocation in the same kmalloc-8k slab could then= > trigger it, right? True, assuming that by 'self-amplifying' you meant this patch creates more kmalloc-8k objects, and also now kmalloc-8k wastes memory memory. > 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 dismiss.= 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) > Sudden memory increase in a LTS due to this backport doesn't sound nice= to me. --=20 Cheers, Harry / Hyeonggon