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 B316E2E7369 for ; Fri, 10 Jul 2026 13:44:57 +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=1783691098; cv=none; b=LRM0lTlMdRcu53hZNcInlbaLDR6FqG2e3gVQZ7uV70rNtogZGX3yMcFH+2dZY13toeEBPoqczUhEvAjhoixcfvjES9ZvPk3Lx8eZSv/eWc9p78wlFOQ/uxwfVvzXf22xNbjKdm1VverLEDM807XWDunv/kC2KjNp2PuG1yTjCO0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783691098; c=relaxed/simple; bh=49fCPTKiQXDe2vBs0aeAafBEApIHMn5/z21njXFh8z8=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=JB219zbdTYjyynP7vTSumSFaBLMhIybmNrJcedUq5OjDgOo/lMcPip8SrwuNUDlq1aDMoppA9FZbgrZ1tGzj30Z5HNOZ3XOsQihuFeyluLbSS21UnihfmRpbm1+oAqXy9rJ4FEwl6efDn4GGAli5gWx53iSfYMLbzETLQT4zJZc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=KkAw23W7; 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="KkAw23W7" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 61B771F000E9; Fri, 10 Jul 2026 13:44:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1783691097; bh=49fCPTKiQXDe2vBs0aeAafBEApIHMn5/z21njXFh8z8=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=KkAw23W7nlT9mTj9JF/9M+J1GfAccKBcwwbAuUkOL0hvJ9ZJuOCqhZIpcDobZZP7i YpN89UtshIQU4hKjfSMETYHO3lFJurQpMbuhNc4eZeODRULMu+OwBabnRkJNaJYbIO f8dbmeVhukHVQwmp6ozzHl7wR5/C5GJS9SkHHlH7/oPS+lADBK/BT5GXWtvfpmWNYf AORODajoqKwQyevmJe9EiAfvNEeJO2jG+xQidZFA9xx8JdJ/bfRLaC/Mp0dc7uMXMj sBjRY9NDqD0/R+Q7+aBG00DqETqPmMtpjwFwUAbdbFDI1zCTRL6ihzo3A6afoNIIqq 0aQI9hJde/sRg== Message-ID: <4a5c8eb6-90f4-412a-93bf-21360fce3c7a@kernel.org> Date: Fri, 10 Jul 2026 22:44:35 +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 slab/for-next-fixes v2 0/3] mm/slab: fix unbounded recursion in free path with memalloc profiling To: "Vlastimil Babka (SUSE)" , Andrew Morton , Hao Li , Christoph Lameter , David Rientjes , Roman Gushchin , Suren Baghdasaryan , Hao Ge , Kees Cook , Pedro Falcato , Shakeel Butt , Danielle Constantino , "Liam R. Howlett" Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20260710-kmalloc-no-objext-v2-0-2709afb6a030@kernel.org> <32a056e2-e641-4aaa-887e-586d997feefc@kernel.org> Content-Language: en-US From: Harry Yoo In-Reply-To: <32a056e2-e641-4aaa-887e-586d997feefc@kernel.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------bh0iCJLSq0YYjqkEhFMD4qVf" This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------bh0iCJLSq0YYjqkEhFMD4qVf Content-Type: multipart/mixed; boundary="------------LHSebdT4vB2ZGMN1riwkJEZQ"; protected-headers="v1" From: Harry Yoo To: "Vlastimil Babka (SUSE)" , Andrew Morton , Hao Li , Christoph Lameter , David Rientjes , Roman Gushchin , Suren Baghdasaryan , Hao Ge , Kees Cook , Pedro Falcato , Shakeel Butt , Danielle Constantino , "Liam R. Howlett" Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org Message-ID: <4a5c8eb6-90f4-412a-93bf-21360fce3c7a@kernel.org> Subject: Re: [PATCH slab/for-next-fixes v2 0/3] mm/slab: fix unbounded recursion in free path with memalloc profiling References: <20260710-kmalloc-no-objext-v2-0-2709afb6a030@kernel.org> <32a056e2-e641-4aaa-887e-586d997feefc@kernel.org> In-Reply-To: <32a056e2-e641-4aaa-887e-586d997feefc@kernel.org> --------------LHSebdT4vB2ZGMN1riwkJEZQ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 7/10/26 10:07 PM, Vlastimil Babka (SUSE) wrote: > On 7/10/26 08:03, Harry Yoo (Oracle) wrote: >> This is a follow-up fix after the recent discussion [1]. >> See patch 2 for the detailed description on the bug. >> >> Based on slab/for-next-fixes (72bb229f916) and will be soon available >> at git.kernel.org [2]. >> >> Instead preventing cycles by bumping up the allocation size of obj_ext= s >> arrays, it introduces a new kmalloc type called KMALLOC_NO_OBJ_EXT and= >> disallow formation of cycles between kmalloc types when allocating >> obj_exts arrays. obj_exts arrays of normal kmalloc caches are served >> from KMALLOC_NO_OBJ_EXT caches (that don't have obj_exts), and all oth= er >> obj_exts arrays are served from normal kmalloc caches. >=20 > Since we agreed to investigate later whether it makes sense to start > allocating all obj_ext allocations from the new type, I wonder if for n= ow we > should not create them at all if they won't be used - if anything to av= oid > polluting slabinfo. That's fair point! > AFAIU that means only create them with mem alloc > profiling is config-enabled and mem_profiling_support =3D=3D true? assuming mem_profiling_support =3D=3D true means not "never"... > (Or probably also with SLUB_TINY && MEMCG, as nonsensical as it is...) I'll instead check "is any kmalloc type w/ higher priority than KMALLOC_CGROUP aliased with KMALLOC_NORMAL?", which would be IS_ENABLED(CONFIG_MEMCG) && (KMALLOC_DMA =3D=3D KMALLOC_NORMAL || KMALLOC_RECLAIM =3D=3D KMALLOC_NORM= AL), --=20 Cheers, Harry / Hyeonggon --------------LHSebdT4vB2ZGMN1riwkJEZQ-- --------------bh0iCJLSq0YYjqkEhFMD4qVf Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYKAB0WIQQQ1ub6gR5ogjaKRmOGXBN6rc5S1gUCalD3QwAKCRCGXBN6rc5S 1rBbAP9swMPew8X20cwWuwn1XEQImWWSR2qmMZhLty5iWRZ7oQEA0a/HLzON3ljk jBI8WgyBFx/efIAV1Ekatq5opFy5Pw4= =EFDt -----END PGP SIGNATURE----- --------------bh0iCJLSq0YYjqkEhFMD4qVf--