From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-181.mta0.migadu.com (out-181.mta0.migadu.com [91.218.175.181]) (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 3F7A22F7EF3 for ; Fri, 12 Jun 2026 03:51:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781236264; cv=none; b=Tb4tp9dgYnIGOzFkacW0RbOl43jQVs4X7TPPjYwJMOLu5l9x9SiLB9gAebnq1EnyryNJlIDqI+BlrcLPpQpWFTeaHAFFKFrhe5y/26vddCshhf0loLJG1cLGmxGMfaCl+3eD5xuaO7wpxI+RhJRfHeqUJSfc0aii8j4x2ivTc4c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781236264; c=relaxed/simple; bh=nUOvwGJABJ96llqmsfb++sL02EEx8wFc5Sj5wDn0e2s=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=nTKp+6j+6jZMiiURT3BbXjbw5Sh/k7nA8dBJPbLAa0P51LExPLqhw7uy9asAlv/jkypNuFRUXaTxx4v2Lbln3AdcPCcN+/HbW/nHVgswidHgFJfKZzD0GfFBew7GjhclTEEIcH1cW6y8EX3kpLWj9hDJ5IHwDojxN4VXr/YNo00= 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=iDVoXPJP; arc=none smtp.client-ip=91.218.175.181 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="iDVoXPJP" Date: Fri, 12 Jun 2026 11:50:28 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1781236261; 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=YFablcsfaJDFV28UgBUNum1R14bfzcLjgvR4MHNUUB8=; b=iDVoXPJPbZ/3PSb05ZM5akVqcgSO4QZ+ARaT2daBspxmVqa6IMcmpUr57SBhcl1lGZXGYE hVWzkEUd076PffVQMKdItpA7i2zDLY7Jiqlav3KFgCJOv1i9x+c+Bxq0+uPptIQPaCsSUg 4Ln5GvpNWulb/ERj7FWip5zcDV/QrVs= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Hao Li To: "Vlastimil Babka (SUSE)" Cc: Harry Yoo , Christoph Lameter , David Rientjes , Roman Gushchin , Suren Baghdasaryan , Alexei Starovoitov , Andrew Morton , Johannes Weiner , Michal Hocko , Shakeel Butt , Alexander Potapenko , Marco Elver , Dmitry Vyukov , kasan-dev@googlegroups.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org Subject: Re: [PATCH v2 06/16] mm/slab: add alloc_flags to slab_alloc_context Message-ID: References: <20260610-slab_alloc_flags-v2-0-7190909db118@kernel.org> <20260610-slab_alloc_flags-v2-6-7190909db118@kernel.org> Precedence: bulk X-Mailing-List: cgroups@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: <20260610-slab_alloc_flags-v2-6-7190909db118@kernel.org> X-Migadu-Flow: FLOW_OUT On Wed, Jun 10, 2026 at 05:40:08PM +0200, Vlastimil Babka (SUSE) wrote: > Add alloc_flags as a new field to the slab_alloc_context helper struct, > so we can pass it to more functions in the slab implementation without > adding another function parameter. > > Start checking them via alloc_flags_allow_spinning() in > alloc_single_from_new_slab() (where we can drop the allow_spin > parameter) and ___slab_alloc(). This further reduces false-positive > spinning-not-allowed from allocations that are not kmalloc_nolock() but > lack __GFP_RECLAIM flags. > > _kmalloc_nolock_noprof() initializes ac.alloc_flags using its flags that > are SLAB_ALLOC_TRYLOCK. slab_alloc_node() and __kmem_cache_alloc_bulk() > are not reachable from kmalloc_nolock() and all their callers expect > spinning to be allowed, so they can use SLAB_ALLOC_DEFAULT. This is > temporary as the scope of slab_alloc_context will further move to the > callers, making the alloc_flags usage more obvious. > > Signed-off-by: Vlastimil Babka (SUSE) > --- Reviewed-by: Hao Li -- Thanks, Hao