From nobody Sat Jul 25 19:28:41 2026 Received: from mail-wr1-f74.google.com (mail-wr1-f74.google.com [209.85.221.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 4DF5A3DA7E6 for ; Tue, 14 Jul 2026 09:32:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.74 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784021539; cv=none; b=PmDZSh2qcHwswQuSnJeH4oalrmqnqteCbmpxxECmKLHXC4Fotcj7PGVT2US9lq7+Km9hopLnYDahggBgevq74HP0rvbnEvx3hHmj7AOrJ//tiRGgocVnPUS1BG/AFpaUCrkhf8oPqVJzUX2mH9dQlwjb7DJBmsg70supgNjU2K0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784021539; c=relaxed/simple; bh=5kDU+AtDAkZe7HSNixy2MNjgMwy8vziw98claMS+DXA=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=f1aGyqxXwn2V7kidKniQT7wWXEevEkrpl7FIFzuvWlO3WIPQXIG2eN3szxLAmSH6sW8aH+WdvVYsYNmhaUs/fWsxbWjbUWexZAaCTHwt1FfWTPlPJtaVueCnJ06NxXp4A/AheFqZnR9dySQxUToZ1MBKo3gN8k2wpULICBQdFZM= 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=rhFxfJV/; arc=none smtp.client-ip=209.85.221.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="rhFxfJV/" Received: by mail-wr1-f74.google.com with SMTP id ffacd0b85a97d-473f4a48e9aso2667764f8f.2 for ; Tue, 14 Jul 2026 02:32:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1784021535; x=1784626335; 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=LTwXaMbWixpG13O8sS4fpRBsh80OpAwJDb/b9qaatlE=; b=rhFxfJV/toTUkSgexK9LrMXIIEMvzN6yrZ+ZuisFQzcwVo4+CS/kZcOG+IZsBipBXp n/Hwu2R9sO1C3FhqcCjKzHUvAbxzR4GkuNAoA/iIChR12kiAGa74WhqFc692bWY7kEcl yG3u/itUw77pbTtRkjARtmYZ/Pr0a4GrYuFajpBZIHvPgjilqKmPy3XNqS4AQjRAce45 mpF96+ZJJojytqzFxAnHluQjTHtZ2CmsPWn/OV5xQpzDgJCAPJBGzaGJ4xjS/RZ+e5Lq M434C2Hrv0HvRccNATByzZzBo/waojG3876pKVSZqbT0um/N2qx2CVt1aQxyRwFkbpzD h5fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784021535; x=1784626335; 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=LTwXaMbWixpG13O8sS4fpRBsh80OpAwJDb/b9qaatlE=; b=IOsql1xTPnZU5Dh1Aiu/nOa0LpFNYSf3dWOqIaUxC6f/4Zff/4gUsIee9Co7ZuFicU bCSYaF48x+xg6rSAC0lU/CDgJYbJLrGw9rs9zRfjV9jDTfmRHHL77ZbumD1U4WOZLhX/ YnoekpcB/JYt2pOVn2aarWkspsd8sazgZR5d1wZ6p+myNsSbQ9deaqQ/8a21JHsjcQwZ nAjlkG4H3QuMH/6+YOc1l7xNl0eiu3teIZ/3Irew1ynPdSpAIpLoxEbYM2nxe7TJNfog j4GABblbL/B+gKXHdYiBtobOyvfGOWpy38J816Ku1k8FrH9aiFMb481fM1IHxm01gYXT xIOA== X-Forwarded-Encrypted: i=1; AHgh+Rp9i3KmjoK9SXHK5O+rZFfVKp6gv8vLSXP4doD3u2gKk8hJtXOoxz/iJIMsFOyc9xE3TKBm06VYDxl3GEk=@vger.kernel.org X-Gm-Message-State: AOJu0YywJTpvb/CHgofY5WcCKUzSCU72fz04bZp2CIRAnz/3TfCCLjEp RcHUGAIwUEaoca+jWtjnN+4uBI3rASpZbL2Lkah5cPN47BqCM37Vp+RvdKu5/xK1TgiN8bPAio3 v5ta0fUgYK2lang== X-Received: from wrte4.prod.google.com ([2002:a5d:5004:0:b0:45e:6a78:7fad]) (user=jackmanb job=prod-delivery.src-stubby-dispatcher) by 2002:a5d:5f87:0:b0:475:f0c2:5b00 with SMTP id ffacd0b85a97d-47f488dea53mr1863182f8f.54.1784021534601; Tue, 14 Jul 2026 02:32:14 -0700 (PDT) Date: Tue, 14 Jul 2026 09:31:59 +0000 In-Reply-To: <20260714-spin-trylock-followup-v2-0-3c20ed032b14@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260714-spin-trylock-followup-v2-0-3c20ed032b14@google.com> X-Mailer: b4 0.15.2 Message-ID: <20260714-spin-trylock-followup-v2-1-3c20ed032b14@google.com> Subject: [PATCH v2 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?=" Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org 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/ Signed-off-by: Brendan Jackman Reviewed-by: Zi Yan --- 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 9c97a86da2b9f..f3f08d0313cfc 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 /* @@ -5410,7 +5410,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 @@ -5533,7 +5533,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 19:28:41 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 58CC12EEE84 for ; Tue, 14 Jul 2026 09:32:18 +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=1784021540; cv=none; b=o2j3PZHKMsITezx9/YFPgl0wt06pFrGlxHHeuQlQ4nbfHk35Eaqq4VzUZ9CdESNKauIoaJSfpS+L7OTbI6XtuxrYJp39kXmBhTuMKov914dadzTMDDwQYG6VtMe1IeXXqWTBn6Jpww7aE4d8vMKeefk796vMhSDMJEAITlUu2jc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784021540; c=relaxed/simple; bh=I2nIXiqF8CDBIeJinazIeMEO150+FXNKrVJTAwrcGMU=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=q8cWSWYOVtD87t++rucwGi2c8gG6kr6i0E8PyXb1SBNo0MSW4lI9LM02T9CuSzzhtr87qE9qvjMJTiI++rTCKtLNUCBYNPkIGklu/SDCbcyWsgxpLIaCnLtac5Bor2KU8Hu40aPLIqf5xzut623ZYhVXJgtsS6uXWKXJAax+E3U= 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=JApYbygb; 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="JApYbygb" Received: by mail-wm1-f73.google.com with SMTP id 5b1f17b1804b1-493c526df6bso6812715e9.3 for ; Tue, 14 Jul 2026 02:32:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1784021536; x=1784626336; 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=TXBjnrDZv69VqIXFsxu8XfktPLqyg9BDT74BtCfYp/c=; b=JApYbygbfKcI8OpuymHJYWSBFIGxwxLYk4SU+7r2nQxHmzzEKBfH8usxBsuMPyxpRm t2QvkruvGrYb+/SLN+b4OuFu3b0WivFwlYcvK7SxTSE7S73E8yZwWPltSZlMvsW6fvqI DKGCfr4NayHxva4djJRJBhJVOnc6RMmXP5Bt4qtqP04PH9ctACfevjzDgzV+HQP3Roy4 IetoPxW8NTiK26LavYVNvjP+yhmdcr0Or8zBNa6enciJ1cE8zh3WgrmlFeFdACBVDnMO EsGGJJRSOxz/pHBxStq92BFI2X52lai3TzRWJO66unA7zaQn5MQuJypCpKdvn25dhxob pQvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784021536; x=1784626336; 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=TXBjnrDZv69VqIXFsxu8XfktPLqyg9BDT74BtCfYp/c=; b=haujibynF5VKHYj0ozX0r4dItrGULnq55e5ibYEUIhONCLW9KtV92Y67HUeqs8ncO6 43Xoiwj+tEsFkITu7JL+84FvjJEGFiCqxrzrcQ5yBfqLdmNugbt2xTsQYMd9ljdQVfDl SF8Q8UlGXtbFL9iJaqpsgKCS2uQsWPGNX1ciW+xjoqufxWyQSNWMCHDmB4lC4Hu7bjOH 9Ikq/niNlH8aG2hKGU4/ouY269NEWp3P3iEzFVKNwMA01uCu/wC8tXNT1/zjB8Du4JSc QybY3QwoF7CXHd3oSCSsTStEd8W9KMraqM17h+RIGTk0/ygSmFvZ8j+5/F4tfALtoM4m hdpA== X-Forwarded-Encrypted: i=1; AHgh+Rqhe0x6Nt4ByyzAJr55h5puxCq1xMaAZiZJBnJQ6lww+ZEBKXrGsmsgWYzdScVf+cY+fMhIAIq5ezbK8qg=@vger.kernel.org X-Gm-Message-State: AOJu0Yy0nhQ+fR7mJl/t5aPxTZJai+DAEYkoniR/r53/5pUWB/Zxs0oU kNHRhSOPHSTqr328yctHEjxVppiVe1xaPByUnL+HCgXnLIVZTOkmMzRACakhS5G72N+Oyry6aQi G/ol9so92qa+T4g== X-Received: from wmcu5.prod.google.com ([2002:a7b:c045:0:b0:493:b008:cbb9]) (user=jackmanb job=prod-delivery.src-stubby-dispatcher) by 2002:a05:600c:8b77:b0:495:f31:7340 with SMTP id 5b1f17b1804b1-4950f3174e5mr30731045e9.5.1784021536099; Tue, 14 Jul 2026 02:32:16 -0700 (PDT) Date: Tue, 14 Jul 2026 09:32:00 +0000 In-Reply-To: <20260714-spin-trylock-followup-v2-0-3c20ed032b14@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260714-spin-trylock-followup-v2-0-3c20ed032b14@google.com> X-Mailer: b4 0.15.2 Message-ID: <20260714-spin-trylock-followup-v2-2-3c20ed032b14@google.com> Subject: [PATCH v2 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?=" Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org 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/ Signed-off-by: Brendan Jackman Reviewed-by: Zi Yan --- 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 19:28:41 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 47AD63F44C1 for ; Tue, 14 Jul 2026 09:32:19 +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=1784021540; cv=none; b=PpZh012qlTYTiJiocxdLKVvFPeVpp5dy1rsDceDBvIs9Yg1+yBPCEP3jB1w1jz9pvnqbu96RL6fWEL1exeyE7tCAYGDIFYF5BL881Jlko/eS4wcJkTHqLvYj7pWRHPG3fxeg5yNnjapG4bZNeeF/QUFHocppV9Z2LenTV8gTvko= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784021540; c=relaxed/simple; bh=2l1s6SY91BitDP9Fk7cMfVdIRCiEIScYANH9F3mzM9w=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=OpXE6a51fI7K4FA1HNpm9iNZYYOuOswprOr4eKDl7ZE0j4aLoOngGvmxP3mV46R4VzS3IIUGPUVpN8FqYW8yC6CV7+eThGZC8Bk4UkOuzatcTy/gq4cPQUbtYVgs14p5EUga0LGUEBRUED+t6hwu8oMpTicr2b15Vz5xOo1Up6A= 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=A4RY5/zI; 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="A4RY5/zI" Received: by mail-wr1-f73.google.com with SMTP id ffacd0b85a97d-47f2ed7cc45so2204778f8f.2 for ; Tue, 14 Jul 2026 02:32:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1784021537; x=1784626337; 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=vZCDTy++eofJtCdYVj/00BJntfZC5+UGNjKSKN7oKjA=; b=A4RY5/zIh0TYZFedQYRVq4GibqudS/PGANFqULJJkI1AeHSF25GC9aGJI6IIj7fmz8 GoRtz9Fduf0d8coiB3t0GZgA9NdzwYtTehv5Rx8j3QC5cORvB0Dv2fk3bJqL+TBVXY/p Hq96JLyRP/BjLDQj+cvEAkma4WEL72YGwufL83QJEVUt5MBZw6Wt2/rVIqrnQ32j3+xJ liSuBQlfbfScSbjyNB8iMaj7QUNuX77jJdAstKfOLyBNHcfpdNLWSH/O9KmJGs8FByLS Mgr7a6WQzNMzERb8Y7xWWNaSSN28qBWPVHLfZWz8h/tOkAf5dotv1jg3PC7j5NaeJZ8Q A42g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784021537; x=1784626337; 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=vZCDTy++eofJtCdYVj/00BJntfZC5+UGNjKSKN7oKjA=; b=VqkBtMKmg2VtKDS439Y8hTohDO3padTZ/zXxfmtolra5cDsgXedin8XXgAA4+Jey7d xxTpR0WT3b8DZRC6Ihp1ofgRmgezermOnJ67fNERcl9cdamfpXZ/j6Ndj6bh8gTpyBAh SXWYXr2qiLYX7wyzBLRmaehp0KXYktTq1j6TGPcz2RAzjf1neAMXLvSYug2BOv7EvUDA tdWCwpgE58Et8oRfM9rsgzwzQyhfisRXA6+axxGCF1jZ6DUIZkAUheWP9/T2leL4WmPh WoSRsU65R3vbErEsqVeK6v9StpKpvS/5Ics5kAAlG8O1iEJZmZBCLNz6Jnj4vo31Eb6f TF4g== X-Forwarded-Encrypted: i=1; AHgh+Rp70eNZyaTQAv7oGMG7n+oW0MWCTsXcoQ3pVTTo3jXbU2GIKhNAcP9GrSzoT24x9ilezn+FnUQ58wscJH4=@vger.kernel.org X-Gm-Message-State: AOJu0YzF9MWZyc0/8zoG80e9jrkwjvOSv9ZMYPIrYm2+aikgKCwhYg1s bUCn2gzJ37iEqHnUCCdvAMAqdXesM5wzW1dmyy/oUgAPkwzwmqIYSuorDglX0FU7w/SiNskEaIW toUq/S39VGHmPOA== X-Received: from wmcv10.prod.google.com ([2002:a05:600c:428a:b0:493:bc21:e2be]) (user=jackmanb job=prod-delivery.src-stubby-dispatcher) by 2002:a05:600c:5297:b0:492:454c:347c with SMTP id 5b1f17b1804b1-494013134aemr75960445e9.7.1784021537240; Tue, 14 Jul 2026 02:32:17 -0700 (PDT) Date: Tue, 14 Jul 2026 09:32:01 +0000 In-Reply-To: <20260714-spin-trylock-followup-v2-0-3c20ed032b14@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260714-spin-trylock-followup-v2-0-3c20ed032b14@google.com> X-Mailer: b4 0.15.2 Message-ID: <20260714-spin-trylock-followup-v2-3-3c20ed032b14@google.com> Subject: [PATCH v2 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?=" Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, 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@google.com Signed-off-by: Brendan Jackman Reviewed-by: Zi Yan --- 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 f3f08d0313cfc..d53f858e518f7 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -7994,7 +7994,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 19:28:41 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 B0ED9403B0A for ; Tue, 14 Jul 2026 09:32:20 +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=1784021542; cv=none; b=EaLXPvtqB28os9U6ad96V8NqGAqxzW9TUcEMe1uM+p2RWg7YWfJau/pwT6k1QCrcjD+/OY8h4pnPLL1DCKC/YZsZ9rgbQMbon5WKHq99QSApcXHg4NKEwhTLhGw+SfZOlY/ppZ2ZQs4dwqRuEqtx1EBbc7Aw6CtAbYsC1KNKtUA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784021542; c=relaxed/simple; bh=loB3HG8brTXzmdSKSsUK401/V7kF9OMrAV2ZVZNmfIk=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=DN3fNvr2e2eG8r5ZOqANCrCfz8qQjXjOlI/uZ0dXciGPfanW7R5wzMFR9vYERdMRzS/Ge4U6SgeHYIrZkDvg36gmL7fN+1glXGTMPtUNmqYGXyCZaj7YbxDU2mZLlzafJvPLnjVBKEl9l1Vs4Kl2u9EVKvYXBvo0xjakEOBEiN0= 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=CwzbUHAp; 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="CwzbUHAp" Received: by mail-wm1-f74.google.com with SMTP id 5b1f17b1804b1-493caa3c54eso40300875e9.2 for ; Tue, 14 Jul 2026 02:32:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1784021539; x=1784626339; 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=WzKR252Snnew5WaAvQzSvTHfEGNrnKkZ6pkR9ltqCAo=; b=CwzbUHAp0nWlTHkFa+h0qE+RUS7GQe639KewU3gLAFfQD/wBRavxlakTZs2oWlw4e7 OhFqKlsR23PYvXtjoUo34/RYYcSEZvH6FUfQWzOR5uHO4LX3DFXcIH/DZTS8oDJ5BaNh XvibGCVavGT9YxVHWIai8QygMc4C5+Fe3n6Nv9jfCRjI/maDD7nWdXtbpI/gk79wwBjH tFJGiQ2PSY+E+GnjnTqzzPO2xf61oNxa68Ycy/flM7j4Q0euiw/v76i1/biVwNCmYLSG TgEW1diK2i5iBioiIJv0D/cDBxSvbjwM0FS9D7BaPBoujTEmZ2djU9Dk7cJX0y2XxYdX FhXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784021539; x=1784626339; 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=WzKR252Snnew5WaAvQzSvTHfEGNrnKkZ6pkR9ltqCAo=; b=LQGCSCOtiZoEaCOKxgExbACbF5HWIaBcb2+JUvoO89rfoE7PHHstcrniOY2TRUbZer RiR7q9wPYQUYBM6hSYgMbK3w/MAMmstn7uRrtmaOKVPwiukq9EXU3N1evJW78vnUzPvb FBulc1uRrya9xj7cbBxf1k68uWz70CgI3gjgXppaL5BZqqZu+7/CaETBwiL2omlsa9kI /dNybVH3wRLH/8QsKFJxv3kIGE98Nrs0lPT/o5JA4TeCh84td6/ktRKSocvwYDKvLTq+ 3VWQw24ZiMI3OpakjITrB2U9d0HoBup52G3JhUxlc5FLQHhVy4TTcoUe1XpVswvslk/e Z50A== X-Forwarded-Encrypted: i=1; AHgh+RoyRlKdZ9BY8kLDvJ0f/raMv4WVb6Bm6LwYQZaSjloeVgCCIl0J3uzlXMzXnaSCnCLqYdMYt2U2Wfpwmyw=@vger.kernel.org X-Gm-Message-State: AOJu0Yy8rKANvHxmw8ESpqrETSizgrCmkTI6qSECqj3UN+e1X8sovyNZ AMGtQHYbu1xX9/xX7ySw5ct1ZZKt+MsJRxAmCsjtUx0ppxWgHlVvZF7zcHQ7p8wB8Uz+YM1G0Au NmAgpMEVNbTHbhQ== X-Received: from wmo8.prod.google.com ([2002:a05:600c:2308:b0:493:bc2d:fea8]) (user=jackmanb job=prod-delivery.src-stubby-dispatcher) by 2002:a05:600c:8119:b0:493:b6e4:fb2b with SMTP id 5b1f17b1804b1-493f882cc20mr115137745e9.25.1784021538718; Tue, 14 Jul 2026 02:32:18 -0700 (PDT) Date: Tue, 14 Jul 2026 09:32:02 +0000 In-Reply-To: <20260714-spin-trylock-followup-v2-0-3c20ed032b14@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260714-spin-trylock-followup-v2-0-3c20ed032b14@google.com> X-Mailer: b4 0.15.2 Message-ID: <20260714-spin-trylock-followup-v2-4-3c20ed032b14@google.com> Subject: [PATCH v2 4/4] mm/page_alloc: remove a VM_BUG_ON() 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?=" Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org 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 this code I am removing this invocation. 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/ Signed-off-by: Brendan Jackman Acked-by: Zi Yan --- mm/page_alloc.c | 1 - 1 file changed, 1 deletion(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index d53f858e518f7..0db1a7281fc33 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -5438,7 +5438,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