From nobody Sat Jul 25 17:35:18 2026 Received: from mail-wm1-f73.google.com (mail-wm1-f73.google.com [209.85.128.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 14B59446842 for ; Wed, 15 Jul 2026 11:03:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.73 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784113421; cv=none; b=C7cPvMieVlsKSqQcvvQPqA7ZuAPW9mXZWRGTde8SLoebHiLxacVx9s+13Z8Ukv7RXwg8gBo1UYYjPf1qHdYnrOnZI1+PGWJ/eSf/98BW/Sn6ji5tysG9NaOqiVrLBKdmL1R3xQ7KBhK/8xoGhaIjnu+pfazWbopQwFluxk6Qzsw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784113421; c=relaxed/simple; bh=CVr87p16kUYIkKSvdn3e7Q96lklgqj1Zs1PBoozN1Ps=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=nvEHVVyN4AaGxNDlpfvDEV4/4OfFI9vJ5nBTld3CqST8wAe51otw57fiVX+nSy4kPZlkrmUDoGIe80fntlIaDWADaB/8VNJowcXSOWg99vZNtv0Ny4rsHniC/irehcXRko9/nbEa0GiBJZ5d9klQ2mX3deezg5kfGFSSINQXGKQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--jackmanb.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=KTt+MHW7; arc=none smtp.client-ip=209.85.128.73 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--jackmanb.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="KTt+MHW7" Received: by mail-wm1-f73.google.com with SMTP id 5b1f17b1804b1-493b21b1fe8so17633185e9.0 for ; Wed, 15 Jul 2026 04:03:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1784113418; x=1784718218; darn=vger.kernel.org; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to :content-type; bh=mf72NgjR/YGP7OyZOYwhsTao63XeRdktGGMG23Y8QgY=; b=KTt+MHW7kllZBDV2cjMSMHoequntxgF5qFjqAmn5Gc1ExjjneNHH6k3I/m3l15LYwn baOhs3YnJQiujt2NfmeKLbe3MOPmylrJ/meUygzClM0440SDwkbOVE5/xHwz9pwzb87S 35BQoezngDn6UwVYQ8LLU9yahQxJmQ74x79DKl508phghegn2ouDjAyXXPbcxELb6/LH jg2nqW+l98ncem5zveJoUME08e4Gs+s4c6s+RAZIhE6huWag7yfhRbCpJsAfNxYKYOe5 M23XcRP8rEIUKKYeKcykXynAdFZR+/Ar7IF6nPa9S0YYtGevuPVugOTnk2MLpfM+umEb PAbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784113418; x=1784718218; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=mf72NgjR/YGP7OyZOYwhsTao63XeRdktGGMG23Y8QgY=; b=WU750E6u2RrQ2VEGBSpzBJLAzoHwnXAGGUSgK3UcFa3AZYLeeZIh4Ed94HOHtjbp2J C3riVr2GR/K2V2Zr5cNSPpwiQffOuzXClzaLpI+udybHJg18fKEVYWtJvwgAM2yfB6pz j8/dV49/05Sxw5SYqfEkVvRFD+/d09GSEd7Qo2AagakeB22V+RlbvuBMU9sYniejmIDa Xm5wsmqICF1Ikn4WzPsOuSaQQDJLh8OFFZdIMSe3DJfU/rX2DSvvSfQWiyo8WaJOM1x3 fGcQJ3mun9X3daB0d9+slC2fWuO3onG21bBSv8+BTSCqEPLhLJ8AnvY0ocpn17ADvbju pTOg== X-Forwarded-Encrypted: i=1; AHgh+RruOI31+dxzEXO0Cfmza+LPAiiw0isrTfaqSn0b0GpuRhcClPezP0og3563ra4YZq6Dxwv6P4pCkCsXMJM=@vger.kernel.org X-Gm-Message-State: AOJu0Ywt+BwzVLC6olRNQ7fzkHQCZxqvdd70yGSz/ON1Jn2T5wqhEgzU 5/DcTZf9i2Sd24aRGcSO52vnrApq8nUHo4HnWVup783VfvPH/lOHMXd71ox/fYV0IO2iaiBaRfE 0Y4F/PjsorVUH/g== X-Received: from wmat13.prod.google.com ([2002:a05:600c:6d0d:b0:495:3c56:7eb1]) (user=jackmanb job=prod-delivery.src-stubby-dispatcher) by 2002:a05:600c:3223:b0:495:50c:259c with SMTP id 5b1f17b1804b1-495050c29d0mr54629235e9.7.1784113418268; Wed, 15 Jul 2026 04:03:38 -0700 (PDT) Date: Wed, 15 Jul 2026 11:03:18 +0000 In-Reply-To: <20260715-spin-trylock-followup-v3-0-fc4d246f705d@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260715-spin-trylock-followup-v3-0-fc4d246f705d@google.com> X-Mailer: b4 0.15.2 Message-ID: <20260715-spin-trylock-followup-v3-1-fc4d246f705d@google.com> Subject: [PATCH v3 1/4] mm/page_alloc: rename FPI_TRYLOCK -> FPI_NOLOCK From: Brendan Jackman To: Andrew Morton , Vlastimil Babka , Suren Baghdasaryan , Michal Hocko , Brendan Jackman , Johannes Weiner , Zi Yan , Sebastian Andrzej Siewior , Clark Williams , Steven Rostedt , Waiman Long , Ridong Chen , Tejun Heo , "=?utf-8?q?Michal_Koutn=C3=BD?=" , David Hildenbrand , Lorenzo Stoakes , "Liam R. Howlett" , Mike Rapoport Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, linux-rt-devel@lists.linux.dev Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable As discussed in the linked patch, the there is some inconsistency between "trylock" and "nolock" nomenclature, let's align it. Since "nolock" is used in the public API it seems to have more mindshare so do that. The linked patch did this for the ALLOC_ flag but forgot about FPI_. Link: https://lore.kernel.org/all/20260703-alloc-trylock-v5-1-c87b714e19d3@= google.com/ Reviewed-by: Zi Yan Signed-off-by: Brendan Jackman Reviewed-by: Vlastimil Babka (SUSE) --- mm/page_alloc.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index af63558391345..c2da85e69a0f8 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -90,7 +90,7 @@ typedef int __bitwise fpi_t; #define FPI_TO_TAIL ((__force fpi_t)BIT(1)) =20 /* Free the page without taking locks. Rely on trylock only. */ -#define FPI_TRYLOCK ((__force fpi_t)BIT(2)) +#define FPI_NOLOCK ((__force fpi_t)BIT(2)) =20 /* free_pages_prepare() has already been called for page(s) being freed. */ #define FPI_PREPARED ((__force fpi_t)BIT(3)) @@ -1419,7 +1419,7 @@ static __always_inline bool __free_pages_prepare(stru= ct page *page, page_table_check_free(page, order); pgalloc_tag_sub(page, 1 << order); =20 - if (!PageHighMem(page) && !(fpi_flags & FPI_TRYLOCK)) { + if (!PageHighMem(page) && !(fpi_flags & FPI_NOLOCK)) { debug_check_no_locks_freed(page_address(page), PAGE_SIZE << order); debug_check_no_obj_freed(page_address(page), @@ -1558,7 +1558,7 @@ static void free_one_page(struct zone *zone, struct p= age *page, struct llist_head *llhead; unsigned long flags; =20 - if (unlikely(fpi_flags & FPI_TRYLOCK)) { + if (unlikely(fpi_flags & FPI_NOLOCK)) { if (!spin_trylock_irqsave(&zone->lock, flags)) { add_page_to_zone_llist(zone, page, order); return; @@ -1569,7 +1569,7 @@ static void free_one_page(struct zone *zone, struct p= age *page, =20 /* The lock succeeded. Process deferred pages. */ llhead =3D &zone->trylock_free_pages; - if (unlikely(!llist_empty(llhead) && !(fpi_flags & FPI_TRYLOCK))) { + if (unlikely(!llist_empty(llhead) && !(fpi_flags & FPI_NOLOCK))) { struct llist_node *llnode; struct page *p, *tmp; =20 @@ -2882,7 +2882,7 @@ static bool free_frozen_page_commit(struct zone *zone, if (pcp->free_count < (batch << CONFIG_PCP_BATCH_SCALE_MAX)) pcp->free_count +=3D (1 << order); =20 - if (unlikely(fpi_flags & FPI_TRYLOCK)) { + if (unlikely(fpi_flags & FPI_NOLOCK)) { /* * Do not attempt to take a zone lock. Let pcp->count get * over high mark temporarily. @@ -2979,7 +2979,7 @@ static void __free_frozen_pages(struct page *page, un= signed int order, migratetype =3D MIGRATE_MOVABLE; } =20 - if (unlikely((fpi_flags & FPI_TRYLOCK) && IS_ENABLED(CONFIG_PREEMPT_RT) + if (unlikely((fpi_flags & FPI_NOLOCK) && IS_ENABLED(CONFIG_PREEMPT_RT) && (in_nmi() || in_hardirq()))) { add_page_to_zone_llist(zone, page, order); return; @@ -3002,7 +3002,7 @@ void free_frozen_pages(struct page *page, unsigned in= t order) =20 void free_frozen_pages_nolock(struct page *page, unsigned int order) { - __free_frozen_pages(page, order, FPI_TRYLOCK); + __free_frozen_pages(page, order, FPI_NOLOCK); } =20 /* @@ -5399,7 +5399,7 @@ struct page *__alloc_frozen_pages_noprof(gfp_t gfp, u= nsigned int order, if (memcg_kmem_online() && (gfp & __GFP_ACCOUNT) && page && unlikely(__memcg_kmem_charge_page(page, gfp, order) !=3D 0)) { __free_frozen_pages(page, order, - alloc_flags & ALLOC_NOLOCK ? FPI_TRYLOCK : 0); + alloc_flags & ALLOC_NOLOCK ? FPI_NOLOCK : 0); page =3D NULL; } =20 @@ -5522,7 +5522,7 @@ EXPORT_SYMBOL(__free_pages); */ void free_pages_nolock(struct page *page, unsigned int order) { - ___free_pages(page, order, FPI_TRYLOCK); + ___free_pages(page, order, FPI_NOLOCK); } =20 /** --=20 2.54.0 From nobody Sat Jul 25 17:35:18 2026 Received: from mail-wm1-f73.google.com (mail-wm1-f73.google.com [209.85.128.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9FDE843FD1D for ; Wed, 15 Jul 2026 11:03:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.73 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784113425; cv=none; b=C0y2SPbA1Hf/JwZtIevvqulYsA2vB39Tj+LUcoILv9JLRFla+xkDbMruc+Pe7gO9mfhR5Q4mVBkgc44b2y4XmgLELR0ysTibFepHc97BHqOzCJvkkDfE2Rd53NprwaRg53w+1kyel3EfObER+gXx9QOxq3ZWLWljS9KI/LHPckY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784113425; c=relaxed/simple; bh=yp7DtpLSpDTNqGYFYJZ54fWV2cqq9H1TNl9IkEg5RcQ=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=CBlsN4oum/B/yZ3YPIuRQX39nhhs1kUxIgwhQBVseWV77ktM8kGjtes5ks+rLRowOGtVR5BBKpX8nmm0j8c4vFhXQ8WWDzNtPJOQhRN33SOGqNiPy9q7c66PZmf6Qv5MXM66SBAASPUHrJVON/xv153ZUu9D2Qm5fxU4fAAPdkY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--jackmanb.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=idqdw5SQ; arc=none smtp.client-ip=209.85.128.73 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--jackmanb.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="idqdw5SQ" Received: by mail-wm1-f73.google.com with SMTP id 5b1f17b1804b1-490a767c7dcso40183455e9.2 for ; Wed, 15 Jul 2026 04:03:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1784113420; x=1784718220; darn=vger.kernel.org; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to :content-type; bh=29O54/g86I/UhsnFuKm5xVq389jfQYeh9pI8FKcXiJI=; b=idqdw5SQstnbIxWinBCL/EG9TvKh0Z/APZPPYTR8NLVzVLyxyCxU873ZZ6hziigj2m 1jSoIzRye9npjbDczF78Q/bfRwp9KV6dbn6PpP1SwEdSKMvePE7ToOn4xbDxYGlCQ4cC geju6Xxcy+GNhROZb4O2tABPmvGp22A3wGK+EI18UkzaeBQgkUyrdPpfBCMedLebvfUo 2COZa1/yQqMo/s/CT1mwn6vclWOD8HjmH/BdQHAWpRF44FGFMw/TmaINll7ZXvUzVLmX EH12xbvbhMQXANm7i/WyoUASoZh+F5cmt4P/ehTgiej7t6IoYByH0rTqR2J+8keCcsLa 3+HQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784113420; x=1784718220; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=29O54/g86I/UhsnFuKm5xVq389jfQYeh9pI8FKcXiJI=; b=dDwEDibJSd6NKML4ujCKv649M/Tk0ysoLHplGy36/TWXMZpJbJfTkttoapFm7JAhdQ 8Dn/EI4uVNEEzTGoF41tAcGyJ69i+e24gBk3E57G6NkiN4t5MlqgGZs9F8ty4qs+Dt7h Lv9L+hXRw2zrdEJabFXy1U5EHex7yrjYpBV/3Xq0vTf91CYujbqquepJ1KU8lgCcv+S3 kwr84TNNpnNg55o/zZ6YveXsiWs1sk4tQTV3XV+anLEuR0b9Jna+IeFFq4qVwqD/TAW3 VBnrJgcLQMEQ01mXJONeEWsECeAxi+BOqsbhhf5XZPFIY/3xqKhGb+7M54LpWSd+JHec bpAw== X-Forwarded-Encrypted: i=1; AHgh+RpME8Nq52Gg+/MnC9aPXyARqhxjSUjBGFvOL/NLHJCnzxasyK3eI8MSsm1W2iKaG8Oo0uvJPLISNZYWXmc=@vger.kernel.org X-Gm-Message-State: AOJu0YwTu7cz2iBTzDAs+Spzedw0PsI24dMm3VDFaz4zUe4SzPYjdTad MfJEOg2isFe4cO/0a0eCpyIJkvGNNeLwwY5cbx499lcDvF/u9UTZtzwNjpPb56Te0d0vdEdSNPx 5UI3biDeySGuG0A== X-Received: from wmqa14.prod.google.com ([2002:a05:600c:348e:b0:48a:79a9:335c]) (user=jackmanb job=prod-delivery.src-stubby-dispatcher) by 2002:a05:600c:1393:b0:493:fa66:4861 with SMTP id 5b1f17b1804b1-4953c273bb2mr27821985e9.25.1784113419548; Wed, 15 Jul 2026 04:03:39 -0700 (PDT) Date: Wed, 15 Jul 2026 11:03:19 +0000 In-Reply-To: <20260715-spin-trylock-followup-v3-0-fc4d246f705d@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260715-spin-trylock-followup-v3-0-fc4d246f705d@google.com> X-Mailer: b4 0.15.2 Message-ID: <20260715-spin-trylock-followup-v3-2-fc4d246f705d@google.com> Subject: [PATCH v3 2/4] cgroup/cpuset: update some comments about the page allocator From: Brendan Jackman To: Andrew Morton , Vlastimil Babka , Suren Baghdasaryan , Michal Hocko , Brendan Jackman , Johannes Weiner , Zi Yan , Sebastian Andrzej Siewior , Clark Williams , Steven Rostedt , Waiman Long , Ridong Chen , Tejun Heo , "=?utf-8?q?Michal_Koutn=C3=BD?=" , David Hildenbrand , Lorenzo Stoakes , "Liam R. Howlett" , Mike Rapoport Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, linux-rt-devel@lists.linux.dev Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable These comments describing the page allocator are out of date: - __alloc_pages() is no longer a public API and has no business being described outside of mm/. - The `wait` variable is gone. It may be out of date for other reasons too but this patch is just fixing the issues that stood out. To fix it: - Instead of referring to a specific function, instead to "the page allocator" - Completely drop out-of-date details of that function's internal behaviour, since they were irrelevant anyway. Suggested-by: Zi Yan Link: https://lore.kernel.org/all/DJP11T5V7BDW.2FZZZ8R6LOY4I@nvidia.com/ Reviewed-by: Zi Yan Signed-off-by: Brendan Jackman Acked-by: Waiman Long Reviewed-by: Vlastimil Babka (SUSE) --- kernel/cgroup/cpuset.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c index 24ea2d09cdbdb..dfd0f827e3b92 100644 --- a/kernel/cgroup/cpuset.c +++ b/kernel/cgroup/cpuset.c @@ -4193,7 +4193,7 @@ static struct cpuset *nearest_hardwall_ancestor(struc= t cpuset *cs) * nearest enclosing hardwalled ancestor cpuset. * * Scanning up parent cpusets requires callback_lock. The - * __alloc_pages() routine only calls here with __GFP_HARDWALL bit + * page allocator only calls here with __GFP_HARDWALL bit * _not_ set if it's a GFP_KERNEL allocation, and all nodes in the * current tasks mems_allowed came up empty on the first pass over * the zonelist. So only GFP_KERNEL allocations, if all nodes in the @@ -4206,11 +4206,8 @@ static struct cpuset *nearest_hardwall_ancestor(stru= ct cpuset *cs) * come before the __GFP_HARDWALL check, otherwise a dying task * would be blocked on the fast path. * - * The second pass through get_page_from_freelist() doesn't even call - * here for GFP_ATOMIC calls. For those calls, the __alloc_pages() - * variable 'wait' is not set, and the bit ALLOC_CPUSET is not set - * in alloc_flags. That logic and the checks below have the combined - * affect that: + * The second pass through get_page_from_freelist() doesn't even call here= for + * GFP_ATOMIC calls. That, and the checks below have the combined affect = that: * in_interrupt - any node ok (current task context irrelevant) * GFP_ATOMIC - any node ok * tsk_is_oom_victim - any node ok @@ -4327,8 +4324,8 @@ void cpuset_nodes_allowed(struct cgroup *cgroup, node= mask_t *mask) * should not be possible for the following code to return an * offline node. But if it did, that would be ok, as this routine * is not returning the node where the allocation must be, only - * the node where the search should start. The zonelist passed to - * __alloc_pages() will include all nodes. If the slab allocator + * the node where the search should start. The zonelist used by + * the allocator will include all nodes. If the slab allocator * is passed an offline node, it will fall back to the local node. * See kmem_cache_alloc_node(). */ --=20 2.54.0 From nobody Sat Jul 25 17:35:18 2026 Received: from mail-wr1-f73.google.com (mail-wr1-f73.google.com [209.85.221.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AC739448CE7 for ; Wed, 15 Jul 2026 11:03:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.73 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784113431; cv=none; b=lIrQdYihV5pg9uCtu5ofTF+y33kwsUgSj/N3vxw2Ln7H7vdtB4J9Wm5e0IEkoGD8WjvtWaI5qYzOPTsyDICD9Crwr7zMSeInXXwL1lLJjEix7s0GvmoGdEvoNJrSsv3bylCxo4tiD8XPFTL7MGFBq299JqptsFW3vHGFOOmHHiU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784113431; c=relaxed/simple; bh=yMYx9T08PdeyCEUHBvkxhJ5enBp6n+9uUVKhIzF7q88=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=qmN2R8o3gxNB6H6nUGuzdJRl+gC/zIBinaMYpD16nlyqkuFOxkDPKo5wnyB9AZBh7HP4kfbwuVqoVIbMB6roemRP3x3oWOPB2kKTmoPzjmH7rEoK/hNbOPKyH/1U+dKQZovC57RxRwrf4JRaVHyrR7x0fJvsdxb1eAB4b2ZHaZQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--jackmanb.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=Dliu1Bli; arc=none smtp.client-ip=209.85.221.73 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--jackmanb.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="Dliu1Bli" Received: by mail-wr1-f73.google.com with SMTP id ffacd0b85a97d-4767036f8faso3282676f8f.3 for ; Wed, 15 Jul 2026 04:03:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1784113421; x=1784718221; darn=vger.kernel.org; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to :content-type; bh=z7jfYCvKZRG50MPG0jJuxwEVxoiBrjqYJeMDmdl5htM=; b=Dliu1BlibDlixMgFh87Oy3oeBimkTBtDgxyB2HHO+faGVgcl65fDeJVLNLMpLnpZiS uWtU3TUpC64pr7YBQho0Fkq52xwTp3YOnkDfZyX0VCqSbgswvGd8q1qwpOqMJSUL/z3v js1AidXP+QqdCXUTv32zvEpWD2x2196AvTecpndU0Yhco6pXAW9PeRCTg8ID/kpIwFcm CayjHf7n4UV7sQ9cR67rhWyLd748+dHj37/OF0Zq0JUoxEiB4ydxSOfrU9X9fboDuynl dKyYNZghUSkwy5TyG9Sc6uXO6jE3tLl/GlkupxIEFSsk4ExOx/g/LOZFJ+7L1TbqfYaN CLwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784113421; x=1784718221; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=z7jfYCvKZRG50MPG0jJuxwEVxoiBrjqYJeMDmdl5htM=; b=YUdEO53EGhNilXwVOU3XeoBrwEvO4BBv94IgcNupAjBzY/2RhmGU5cFqIUWM83MZjI rg9Sl/qohPJ3TuZjj76B8azmzTVnA60yw/4OLN2SeZy7YUo5Ajy4WOVluliwrMKr/aHe k8u/n3dYyEqqi7EUHKYqn9xxhuzbL2YWJU2l9nXa7SvSl394qlw3Fm/g0Ceb3kgEUGD3 1ix10DbWwwYbxJB6nA6puXfC5CJnY5cGBpRJ09eD1unAuCboZRnqlcngcY2Rnbh2Ua17 2nINvmb+3hMxju8koWioCqGv4BhPBkE8LfYBorfMnjUKGDCPFWixrQxdEHJvznutlCrw LQgQ== X-Forwarded-Encrypted: i=1; AHgh+Rp+d7hhjuX0SZrBk/f7Z7cNtQYP8e/jPCVkP+TILa87Sqb9XyGUjFzSjgMRiFJ4D6MTNwT9DASi0UaOPRc=@vger.kernel.org X-Gm-Message-State: AOJu0YwzAkEYatHw1577AiJ3TGoldPeF9vyumOE2cgNBjo/2yseODmgC boNj22h4Vl4R7AWz5HXhzmaY9W3uZCrKXM32qhUPovW9oPqzr4GBK453p6greJyOq6beXRpu6PK k+m1Lhf5G5rc7KQ== X-Received: from wruj11.prod.google.com ([2002:a5d:618b:0:b0:46d:8498:a146]) (user=jackmanb job=prod-delivery.src-stubby-dispatcher) by 2002:a05:600c:6989:b0:494:6baa:ccef with SMTP id 5b1f17b1804b1-4953c1555a0mr25987965e9.11.1784113420581; Wed, 15 Jul 2026 04:03:40 -0700 (PDT) Date: Wed, 15 Jul 2026 11:03:20 +0000 In-Reply-To: <20260715-spin-trylock-followup-v3-0-fc4d246f705d@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260715-spin-trylock-followup-v3-0-fc4d246f705d@google.com> X-Mailer: b4 0.15.2 Message-ID: <20260715-spin-trylock-followup-v3-3-fc4d246f705d@google.com> Subject: [PATCH v3 3/4] mm/page_alloc: fixup alloc_pages_nolock_noprof() comment From: Brendan Jackman To: Andrew Morton , Vlastimil Babka , Suren Baghdasaryan , Michal Hocko , Brendan Jackman , Johannes Weiner , Zi Yan , Sebastian Andrzej Siewior , Clark Williams , Steven Rostedt , Waiman Long , Ridong Chen , Tejun Heo , "=?utf-8?q?Michal_Koutn=C3=BD?=" , David Hildenbrand , Lorenzo Stoakes , "Liam R. Howlett" , Mike Rapoport Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, linux-rt-devel@lists.linux.dev, sashiko-bot@kernel.org Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Update the comment to reflect the recent change to allow flags in gfp_nolock. Reported-by: sashiko-bot@kernel.org Link: https://sashiko.dev/#/patchset/20260703-alloc-trylock-v5-0-c87b714e19= d3%40google.com?part=3D6 Reviewed-by: Zi Yan Signed-off-by: Brendan Jackman Reviewed-by: Vlastimil Babka (SUSE) --- mm/page_alloc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index c2da85e69a0f8..25a83a57aab66 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -7983,7 +7983,8 @@ struct page *alloc_frozen_pages_nolock_noprof(gfp_t g= fp_flags, int nid, unsigned } /** * alloc_pages_nolock - opportunistic reentrant allocation from any context - * @gfp_flags: GFP flags. Only __GFP_ACCOUNT allowed. + * @gfp_flags: GFP flags. Only __GFP_ACCOUNT, plus some flags that get set + * internally regardless (see %gfp_nolock) are allowed. * @nid: node to allocate from * @order: allocation order size * --=20 2.54.0 From nobody Sat Jul 25 17:35:18 2026 Received: from mail-wm1-f74.google.com (mail-wm1-f74.google.com [209.85.128.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E6B3F44331F for ; Wed, 15 Jul 2026 11:03:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.74 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784113427; cv=none; b=rBiCegk00GU0n7RgOJ7b9ihqdKyIW/KLBGhFKNwmCjeqi3Su+i203WR50mBMpeEgy70iLmsh3Zfg5As83X9VTnfzSbmzrp3VAynSIrFz5kNAxL5suldma2uE8zlOPuDgkjHKVbjkvKPBOU3OldFSnfc0+pQ1SKICqcJ0zTaX3do= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784113427; c=relaxed/simple; bh=J6H+FoeqiU5MQFbzUvf2h1acD2Gc0AUhstmNBmOjGho=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=hVG9P1Fmmg1Bkwijcm3Sj0aJVgqmw2BUO5c1ZCxHyglFNoNXy1boQw4+aN6BHlWT9CxGJPrZxBC/4AEdUL57Wrvh+txzSdzq5Rmd0akxcU3bE7MH0MrtopMzTf+/CiA3GFvuRtAFJGEu24ByIJeNrUQ+BK+9HTErT5isNAf2iVE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--jackmanb.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=i3lNIw2x; arc=none smtp.client-ip=209.85.128.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--jackmanb.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="i3lNIw2x" Received: by mail-wm1-f74.google.com with SMTP id 5b1f17b1804b1-493fa6e28a7so30319835e9.1 for ; Wed, 15 Jul 2026 04:03:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1784113422; x=1784718222; darn=vger.kernel.org; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to :content-type; bh=dz86EwLqIg9rsRKy2+oVo0cZ8RAfDlpYQ8xyeR+GWfk=; b=i3lNIw2xeMpxYwYzM8naVyRgQp5PAXiLHUy9V2K3GirLBocN7FuHOV6gTAti6kTAKH G08pbVe0UvruAdcd13goBm1+Ztg2tTfSHAw3mUc6ze++QCSKQb42yIdcWdIfOi34kOGF DfpiMyE3/aDfd7MoFj5VZdI9LLsD5BjQhDKUU83SuHdWW2hUFh29iCisakKMfuppuYM9 EaPki2aK+TR0zt+PHgkYk5ku/e0wZJ5doD9fZPk9rfwbVAxL4ngGvp7+Mr5OvL6pAMtt qoC/bxOCSlhs9cRTS+yC6NSS6IFlqicq6nZeChJ/blBhdZXURLGZ2nKbaOTDAzCu0qP3 9goQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784113422; x=1784718222; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=dz86EwLqIg9rsRKy2+oVo0cZ8RAfDlpYQ8xyeR+GWfk=; b=MTpY/I1u8KfAUnLa1T1VQzhprB0EGprzI4dRNiJezscjlTw4C0Dn+RgLxfWU4tDNzT yGUvvSpBqmHhOosBZkLke6CpdB3N160dkPhod95c4dLq+CV9TsXg64DlJMx3fU09TuUO 1ntGN+6SMrQz8vTvGb49rC8OPBe3d/R2DJJx9y9maNl2Yo5EzxHQ4IyWIdhHIHwtz6EZ utxwQ1nZKECYhuLoKb5KZoLUMH7qDTxa/xdbB03u2hj0uktXl0NBnnBjxKSwJkiIq8ka 6FgtlG4a80C/tlhNDs4IAhbEXboBvBUys4NRISxvTDQV4ZJQh2CW0swkcAmoYCt+A23Z xIfQ== X-Forwarded-Encrypted: i=1; AHgh+RrKndohhSVoowZqkVSw0+cyHVIWhgD81JYySt4CjoePlMdGx6OqOfrrglu7xYeYsVGznvfCIYCzmTXkjtU=@vger.kernel.org X-Gm-Message-State: AOJu0YwOv//TduVONln+1cW09WZ5NumAMd3uz7eCZWQxWPC+fAAQGsaL nFND8NdV82hV3xQfuZJEcelONjBJbS6BzpRyEXPfhoBWY7vhtNH6K7DoIXRxEPnh7VFiIyEz8U1 ZawDJtT4wu/LzXw== X-Received: from wmoh4.prod.google.com ([2002:a05:600c:3144:b0:490:b2a6:e6f5]) (user=jackmanb job=prod-delivery.src-stubby-dispatcher) by 2002:a05:600c:3e0d:b0:493:b499:3ef2 with SMTP id 5b1f17b1804b1-4953c299474mr25989985e9.37.1784113421736; Wed, 15 Jul 2026 04:03:41 -0700 (PDT) Date: Wed, 15 Jul 2026 11:03:21 +0000 In-Reply-To: <20260715-spin-trylock-followup-v3-0-fc4d246f705d@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260715-spin-trylock-followup-v3-0-fc4d246f705d@google.com> X-Mailer: b4 0.15.2 Message-ID: <20260715-spin-trylock-followup-v3-4-fc4d246f705d@google.com> Subject: [PATCH v3 4/4] mm/page_alloc: remove a couple of VM_BUG_ON()st From: Brendan Jackman To: Andrew Morton , Vlastimil Babka , Suren Baghdasaryan , Michal Hocko , Brendan Jackman , Johannes Weiner , Zi Yan , Sebastian Andrzej Siewior , Clark Williams , Steven Rostedt , Waiman Long , Ridong Chen , Tejun Heo , "=?utf-8?q?Michal_Koutn=C3=BD?=" , David Hildenbrand , Lorenzo Stoakes , "Liam R. Howlett" , Mike Rapoport Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, linux-rt-devel@lists.linux.dev Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable VM_BUG_ON() is out of favour and on the way to removal, since I recently touched alloc_pages_node_noprof() I am removing that invocation, and also removing the __folio_alloc_node_noprof() one for consistency. If this precondition is violated, the system will soon crash anyway. Suggested-by: Zi Yan Link: https://lore.kernel.org/all/7F866265-3F2E-4765-B9D4-9AB898A9C4AC@nvid= ia.com/ Acked-by: Zi Yan Signed-off-by: Brendan Jackman Reviewed-by: Vlastimil Babka (SUSE) --- include/linux/gfp.h | 1 - mm/page_alloc.c | 1 - 2 files changed, 2 deletions(-) diff --git a/include/linux/gfp.h b/include/linux/gfp.h index 4d57e9c0bf204..872bc53f32ec8 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h @@ -255,7 +255,6 @@ static inline void warn_if_node_offline(int this_node, = gfp_t gfp_mask) static inline struct folio *__folio_alloc_node_noprof(gfp_t gfp, unsigned int order, int= nid) { - VM_BUG_ON(nid < 0 || nid >=3D MAX_NUMNODES); warn_if_node_offline(nid, gfp); =20 return __folio_alloc_noprof(gfp, order, nid, NULL); diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 25a83a57aab66..4c6815f84adc6 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -5427,7 +5427,6 @@ struct page *alloc_pages_node_noprof(int nid, gfp_t g= fp_mask, unsigned int order if (nid =3D=3D NUMA_NO_NODE) nid =3D numa_mem_id(); =20 - VM_BUG_ON(nid < 0 || nid >=3D MAX_NUMNODES); warn_if_node_offline(nid, gfp_mask); =20 return __alloc_pages_noprof(gfp_mask, order, nid, NULL, ALLOC_DEFAULT); --=20 2.54.0