From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-170.mta0.migadu.com (out-170.mta0.migadu.com [91.218.175.170]) (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 19CDA2F5A36 for ; Thu, 16 Jul 2026 18:06:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784225178; cv=none; b=GgdlHahaTPSbrIM/8xohQRwNaSUBIE/Z0N3xFwN1/vkHDtvPEWiCNrQm5vAaZazAcy2jW3PA/ZXJpcOXFOeFXU+rhPT2sIpNqlNxyuU/2A1MQdP+G/ZujoIn5Eva3HKhg8Y+hfKY4ETTfurMhg7MxrHVrPx/Xk2ZS3cNuyHrTvY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784225178; c=relaxed/simple; bh=0rDnsEIjaBa8ZGQMH2zPGsTwsYlrKvdHCDAbMY/6PPw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=t7bAC4JIfZno7oTW7OQOSorvGaxOsgWTosm6MTeVcSVV6z1OztbgP0QiFCtxxYIGlWfO+z2tQHQjxjPMTfi0asZbL1T5vsNrQodD8ze8T9aaV3UzSh0eRxvUtatmmjv1+8lgDpvM+Wza0hkNDqbfdktdqakF/rDxQHGUmKH5v0U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=hH6d6djr; arc=none smtp.client-ip=91.218.175.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="hH6d6djr" Date: Thu, 16 Jul 2026 11:05:46 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1784225172; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=wa6HtovuUo2/Dy2hy3Xy7z6a2LMOziGqXVtUFribJHU=; b=hH6d6djrmw1ef58fFFFYFsvkVZ92ZppW59P9voPPHdc665uNYIzFhGLzMPZP2ZGdPi9sqq 801Ygu1t4YD4auD8ZVD7TkAqfehlYdJe0XSS7uU6UgHBXHAT8g2wralfdLmSsdMKJQldbH QOhFCkXs1FrA2N7d3zviGEm+n3ZA6V0= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Shakeel Butt To: "Harry Yoo (Oracle)" 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 Subject: Re: [PATCH slab/for-next-fixes v3 0/4] mm/slab: fix unbounded recursion in free path with memalloc profiling Message-ID: References: <20260713-kmalloc-no-objext-v3-0-47c7bd138de7@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260713-kmalloc-no-objext-v3-0-47c7bd138de7@kernel.org> X-Migadu-Flow: FLOW_OUT 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_exts > 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 other > 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 lack > 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. Hi Harry, are you planning to send the backports to stable once this merges into linus tree?