From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-171.mta0.migadu.com (out-171.mta0.migadu.com [91.218.175.171]) (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 E8F2E28504D for ; Thu, 18 Jun 2026 08:08:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781770099; cv=none; b=jgZb9dhkGhrRRNzQJpLY8fdgnnwMK6zSdtNkXhm9UqM4wN8bOebtQL7i2uIBZnyVDG2ew76kFG4uxfThj4ZoIU/umLh0F4QlXU8hRx5nNkvQZTph8GKY0o7u6yrULCsND2R32suoj7Jc8FCmz4OKEArKcneeCrhzIrNj3uq4hYw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781770099; c=relaxed/simple; bh=Aq+bz306tdqplwWenAQrSy7uL7k3HPOkk7IHbNSCxRY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=XMX2Rs7ScbNEkyYq6sSgPv+ciJIyCwYPrKOHRJX9Dhv42xH9KitEPHGcKo7hUBjhV+dz9cdXkI/9442XC6z4kWGQ8cvAbmagH9U3vyODZj3/dgjaVbzjJydctZAuq1H1PCAGGc0W4zcm/Hc60GcxjRe68MgLbap9pG3uEfDG+zM= 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=SXq+fbg1; arc=none smtp.client-ip=91.218.175.171 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="SXq+fbg1" Date: Thu, 18 Jun 2026 16:07:31 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1781770085; 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=jkAOAOVNxrErE4lST04O8nu7mROfXmewRbNfCGnfWZY=; b=SXq+fbg1e/awOwIfamMM8xAxZL4FJQG9plaLKuhBgI+yWitVniATtbZzuyg/T1iJ3yk+DR PNP66JRqv9chFFiWNT+q8H7AihMZ1MkYxcdCYjjd5vetTaM6A+7mJ+M7y5R1E+NOpd6D9Q mLmO259d2XIbkbqfb03u0Z0gyrcwjJc= 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 v3 08/15] mm/slab: pass alloc_flags through slab_post_alloc_hook() chain Message-ID: References: <20260615-slab_alloc_flags-v3-0-ce1146d140fb@kernel.org> <20260615-slab_alloc_flags-v3-8-ce1146d140fb@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: <20260615-slab_alloc_flags-v3-8-ce1146d140fb@kernel.org> X-Migadu-Flow: FLOW_OUT On Mon, Jun 15, 2026 at 01:54:41PM +0200, Vlastimil Babka (SUSE) wrote: > Convert the whole following call stack to pass either slab_alloc_context > (thus including alloc_flags) or just alloc_flags as necessary: > > slab_post_alloc_hook() > alloc_tagging_slab_alloc_hook() > __alloc_tagging_slab_alloc_hook() > prepare_slab_obj_exts_hook() > alloc_slab_obj_exts() > memcg_slab_post_alloc_hook() > __memcg_slab_post_alloc_hook() > alloc_slab_obj_exts() > > Converting all these at once avoids unnecessary churn and is mostly > mechanical. > > This ultimately allows to decide if spinning is allowed using > alloc_flags in alloc_slab_obj_exts(), as well as slab_post_alloc_hook(). > Aside from alloc_from_pcs_bulk() (to be handled next) there is nothing > else in slab itself relying on gfpflags_allow_spinning() which can > be false even if not called from kmalloc_nolock(). > > A followup change will also use the alloc_flags availability in the call > stack above to remove the __GFP_NO_OBJ_EXT flag. > > For alloc_slab_obj_exts(), also replace the suboptimal "bool new_slab" > parameter with a SLAB_ALLOC_NEW_SLAB flag with identical functionality. > > To further reduce the number of parameters of slab_post_alloc_hook(), > also make 'struct list_lru *lru' (which is NULL for most callers) a new > field of slab_alloc_context. > > Link: https://patch.msgid.link/20260610-slab_alloc_flags-v2-9-7190909db118@kernel.org > Signed-off-by: Vlastimil Babka (SUSE) > --- Looks good to me. Reviewed-by: Hao Li -- Thanks, Hao