From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-182.mta1.migadu.com (out-182.mta1.migadu.com [95.215.58.182]) (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 2687C2F7EF3 for ; Fri, 12 Jun 2026 03:50:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781236203; cv=none; b=SyuE8y7ttmuB6jcMfSJdFCXi/Dw1qmD4sqglxDPrun2lZnoLo4M6hWM7JQ1bP/bLpyFaPIvgTAAVGGLnoj8iMyWgWuz0vB1YF4oiQwXk1FKy8Ls9WZ94wCBlKZQl1tYBk9RLqMT4gz30G57Dynyy//V8975CH+DhyIGw/u9zMGE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781236203; c=relaxed/simple; bh=6YDnyl+NTmBwmgeaa2NWCuN3n+3EutNTkE0zEPAtkrI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=fL7oSd3AyjUPTnjanZg/gRgjnOBGOoWnMw9KXGKKzsuI+0+5JUJd0uykLfSngR5Oytrg9C41NbF4W0wOWPPGyTU3sfLPaMMFCnl7fgZcg/gOpMrjemuxIyLn62moTuF52HJaCUI/vExImaKrpP6L5fUZ5wsBCvmacGC+cKgpX2A= 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=s/MyNDrW; arc=none smtp.client-ip=95.215.58.182 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="s/MyNDrW" Date: Fri, 12 Jun 2026 11:49:10 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1781236190; 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=ixiQyVcnY3YM6U4Uy1f3lDFZTErmkQjeBnlfx6n7LgU=; b=s/MyNDrWb1pU/BXD6bpLz0rJoAePBgxJvUr6QVez9L3LkBGjOQInrcL1rqRUUrwq3Dpu6M omIbmFHhMYnzSMKHvjT5i05ejKg/w8VIo6UYiHOCH7GhESGXUnE4o1Ra1kmlNRB1G+jhYn id4UwS6u815FUDzrY1XJRFiEYFa0R/8= 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 05/16] mm/slab: introduce alloc_flags and SLAB_ALLOC_TRYLOCK Message-ID: References: <20260610-slab_alloc_flags-v2-0-7190909db118@kernel.org> <20260610-slab_alloc_flags-v2-5-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-5-7190909db118@kernel.org> X-Migadu-Flow: FLOW_OUT On Wed, Jun 10, 2026 at 05:40:07PM +0200, Vlastimil Babka (SUSE) wrote: > Similarly to the page allocators, introduce slab-allocator specific > alloc flags that internally control allocation behavior in addition to > gfp_flags, without occupying the limited gfp flags space. > > Introduce the first flag SLAB_ALLOC_TRYLOCK that behaves similarly to > page allocator's ALLOC_TRYLOCK and will be used to reimplement > kmalloc_nolock()'s "!allow_spin" behavior. That currently relies on > gfpflags_allow_spinning() and thus the lack of both __GFP_RECLAIM flags, > importantly __GFP_KSWAPD_RECLAIM. This can give false-positive results > e.g. in early boot with a restricted gfp_allowed_mask. > > Also introduce alloc_flags_allow_spinning() to replace the usage of > gfpflags_allow_spinning(). > > Start using alloc_flags and the new check first in alloc_from_pcs() and > __pcs_replace_empty_main(). This means some slab allocations that were > falsely treated as kmalloc_nolock() due to their gfp flags will now have > higher chances of succeed, and this will further increase with followup > changes. > > Remove a WARN_ON_ONCE() from refill_objects() as it's now legitimate to > reach it from a slab allocation that's not _nolock() and yet lacks > __GFP_KSWAPD_RECLAIM for other reasons. > > Signed-off-by: Vlastimil Babka (SUSE) > --- Reviewed-by: Hao Li -- Thanks, Hao