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 4816433B6C4 for ; Fri, 17 Jul 2026 04:09:46 +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=1784261387; cv=none; b=f8K8PmVuqBJirgd/qoyWGbifjZDaAsmfsE88BIexTdvI8Em9nuTWeCd7n0NyNzNp8kTdTSk5OQaDyFT5f10pBxk799dnif7X+qcgh3O+fiz1BAqZ8f6xB+PR30ZCOIkUz2lyiLtUIAoGIk4Yd8vvjj44OZbR4sJQKfXEhBwqRiw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784261387; c=relaxed/simple; bh=edGbSK8TjCQzoqJgD44mkiQBfxhpKtjMEjrxayeSpPo=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=LJmKB32a1tFkI2VgxAqAfgaJVvU8uAqtx8jUiHdwVytEF/kHch+xifttIGxay1IqKq+i9L0+APO7DC7ndKDH5VKHL2CR1pYM5gkOlBUj8qzgYw3lXuuOtkaF9PaCzcGss26PQXJnMQN++g/Lc/CZs5AbGzXafKUtbT8vq+EBKkk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=WnsCwBS3; 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="WnsCwBS3" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B1F201F000E9; Fri, 17 Jul 2026 04:09:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1784261386; bh=edGbSK8TjCQzoqJgD44mkiQBfxhpKtjMEjrxayeSpPo=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=WnsCwBS36OJEP3bzOpRdgkN9Rt6YpelKHYJxHxSpP6gjDw9UPV89RzQ+Pxry/c3Iw FhsE2r6SRCAQpdy1mnkvDUwXsWWbwhTwX8jHcqsfhy8Z28L7adsvGtprh6WVovXmCG OWRGjysCgfEBIBX/dZG5/xSmXPMGZstbn9RzT2DsuEX10FO9nvjN41vOdaGUtDSfws DwKtw6p5qODsdWl+wgElVTWFS2fmSISHopXe9K80SYJ5dH9hTUEtMtcLApjLyNyLfe bYcL9/HfYZXvP/KyfstIEU5f8JItU3hn+wKdyxSGJIX/Oy61DW9AVMMTdQbE2QoSky +/WeFSRdhIXAw== Message-ID: Date: Fri, 17 Jul 2026 13:09:31 +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 v3 0/4] mm/slab: fix unbounded recursion in free path with memalloc profiling To: Shakeel Butt Cc: Vlastimil Babka , Andrew Morton , Hao Li , Christoph Lameter , David Rientjes , Roman Gushchin , "Liam R. Howlett" , Suren Baghdasaryan , Hao Ge , Kees Cook , Pedro Falcato , Danielle Constantino , linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20260713-kmalloc-no-objext-v3-0-47c7bd138de7@kernel.org> Content-Language: en-US From: Harry Yoo In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------Jiwqshj8DHDXqCQJEX0Nuazd" This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------Jiwqshj8DHDXqCQJEX0Nuazd Content-Type: multipart/mixed; boundary="------------MKPm6oOgpMGWbq99AxRL9FA0"; protected-headers="v1" From: Harry Yoo To: Shakeel Butt Cc: Vlastimil Babka , Andrew Morton , Hao Li , Christoph Lameter , David Rientjes , Roman Gushchin , "Liam R. Howlett" , Suren Baghdasaryan , Hao Ge , Kees Cook , Pedro Falcato , Danielle Constantino , linux-mm@kvack.org, linux-kernel@vger.kernel.org Message-ID: Subject: Re: [PATCH slab/for-next-fixes v3 0/4] mm/slab: fix unbounded recursion in free path with memalloc profiling References: <20260713-kmalloc-no-objext-v3-0-47c7bd138de7@kernel.org> In-Reply-To: --------------MKPm6oOgpMGWbq99AxRL9FA0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 7/17/26 3:05 AM, Shakeel Butt wrote: > On Mon, Jul 13, 2026 at 11:28:48PM +0900, Harry Yoo (Oracle) wrote: >> This is a follow-up fix after the recent discussion [1]. >> See patch 4 for the detailed description on the bug. >> >> Based on slab/for-next-fixes (af9ea231c0b45) and is 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. >> >> I tried to reuse SLAB_ALLOC_NO_RECURSE to make kmalloc_slab() select >> KMALLOC_NO_OBJ_EXT, but it was not great because it does not allow >> sheaves for those caches. So I introduced a new slab alloc flag >> SLAB_ALLOC_NO_OBJ_EXT. >> >> To avoid huge confusion, I had to decouple "disallowing sheaves" >> semantics from SLAB_NO_OBJ_EXT and introduced SLAB_NO_SHEAVES. >> >> While this cannot be directly backported to v6.18 and v6.12 due to lac= k >> of SLAB_ALLOC_* flags and kmalloc_flags(), I don't this will be >> particularily challenging to backport it. Instead of a new slab alloc >> flag, we can use __GFP_NO_OBJ_EXT to select KMALLOC_NO_OBJ_EXT as >> kmalloc caches don't have sheaves in v6.18 anyway. >=20 > Hi Harry, Hi Shakeel, > are you planning to send the backports to stable once this merges into > linus tree? If somebody wants to give it a try, that would be great! Otherwise I will send backports although it might take some time as I'll be working on and off for a while :) --=20 Cheers, Harry / Hyeonggon --------------MKPm6oOgpMGWbq99AxRL9FA0-- --------------Jiwqshj8DHDXqCQJEX0Nuazd Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYKAB0WIQQQ1ub6gR5ogjaKRmOGXBN6rc5S1gUCalmq+wAKCRCGXBN6rc5S 1qmHAQD+ufBk+XgySKJ85ury9U++anJWJL1IaC/8hVQx4p66pAEA8wo/1GOFFady eGF8ls3ggok50tIUz7P10M+D0UTQYwY= =RP2N -----END PGP SIGNATURE----- --------------Jiwqshj8DHDXqCQJEX0Nuazd--