From mboxrd@z Thu Jan 1 00:00:00 1970 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 482B43D34BA for ; Fri, 3 Jul 2026 12:32:19 +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=1783081943; cv=none; b=t3ip7eytnqZbpfzbLu6+2H/JU/EVY7yml2wVBQbUHOP8ZvYvckfG4qgVoLE+AZU3qxMEuvvVQE2Dezm/hz8hxEfE/ACr+Mf0dLHnY/ZtqgzVHCEOrtH3SLexMdYKJFKX538Ds637f7WTk0z814RKdoLG1bmB5PwSmMB+6oP/QVo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783081943; c=relaxed/simple; bh=XSMEx7/rnQ/A8Pwk/KpzBBynrXnVI6BQCpv6JO2sLSQ=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=btDL2rlzPoD85IVtqDNBcPa2fiyWAi0GeOP4RlVA1QXVhc+e11dpix+8uXexvT03uL4jKRYWvdrktjXS5voR5yudMCFLI4ghnNu4xWyWeuciF5CmQAm4X9cnU95kWIvHQpGaGTwmG0MUV3HJpwghOuFIY52qB4rjlfCcpjLpfhQ= 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=P23kKQ+d; 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="P23kKQ+d" Received: by mail-wm1-f74.google.com with SMTP id 5b1f17b1804b1-493c588b6f2so4077435e9.0 for ; Fri, 03 Jul 2026 05:32:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1783081938; x=1783686738; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=QxpluEDl6Bvs+YrJCKdo0lCaCsO0ieanT5jt0bN1dTA=; b=P23kKQ+d0i6T9xB91oRR/yOjK553gieV+4wvD0JiM/cFqc0hHDZwBo+iNnFVHB7DJh KF+qMjIeowm71uzuIquACMnZ4XXz0g4oF4vzxFNIpocXtJMNdrIVh2UB7TJOKMJmBgFA BbdyWkol+zwyub+Kbr6CENl+dOrzfCRShQqQesIc8hNI0N7ar/oYEX88T+c6y7LmCdIZ QOkAzL0lyQbhiB4FnY0zm1KpRdJVMjRlOT0osZHz7c/gCwGcHDMZbZZGITP3TTmPUu8k XOzXrOWpTLGYLycklbvdqg/+Md/BkZU3ZsR/g7u4P4D1lmJ6fkoe0VNCLVjgZBA8RgJw 4HKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783081938; x=1783686738; h=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; bh=QxpluEDl6Bvs+YrJCKdo0lCaCsO0ieanT5jt0bN1dTA=; b=QXusxg9FrlEueARPO3Yqc7fhzlaJUcyDDYs4UO3lIwLbyiLCSy90DROTKtdQsriZQc E7+CC1j9FGjxCkprInlmAObVqZ5k+q1dA2eOVYy0OVT00caXBGv2qkau6TUiGuNQDfSQ GM7xHwY71kkO8QrK3rWdvdO+/Qwv82/ZR+h3sBTKO8ZkXsL/1T9tepYgW1f1uvvV59BT F2igvSle7nX7zSvXwxT5l4eKREC02Gupu0Sn6TGkfZecvQqUESdgrl4hdimjWFLDPp6V 2iUAyLKEVgYO2bJHXYs3d0g6XSE18bP/d5Rd4Yv5fpEzBq72D4j1FrIlH4Ahc13H3Qaq MOSg== X-Forwarded-Encrypted: i=1; AFNElJ9l1JcvyQ5iLeSScwR/NbkLUd1LEMjBqodgZFTXzdR0szJ4OSzSv/5Nl9JqK/L5XMIP0PerrHB0mspV/A4=@vger.kernel.org X-Gm-Message-State: AOJu0YztAHSaknNcizj5Hr4rW7AxkAjd64cK+hkAx9m19p/oNnY8/slO 9X5PT6plB3wQ9kJ0fM77EAaQrBiA7qTcLv3CvJgfIoHnxDlmbCl0wOkWpHE3cwloq4l16FSZSn1 9DTHEI2MlXrfqrA== X-Received: from wmqn2.prod.google.com ([2002:a05:600c:4f82:b0:489:1b01:386f]) (user=jackmanb job=prod-delivery.src-stubby-dispatcher) by 2002:a05:600c:1c1c:b0:493:c1a1:68f0 with SMTP id 5b1f17b1804b1-493c2b6e672mr171824055e9.20.1783081937799; Fri, 03 Jul 2026 05:32:17 -0700 (PDT) Date: Fri, 03 Jul 2026 12:31:41 +0000 In-Reply-To: <20260703-alloc-trylock-v5-0-c87b714e19d3@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260703-alloc-trylock-v5-0-c87b714e19d3@google.com> X-Mailer: b4 0.15.2 Message-ID: <20260703-alloc-trylock-v5-1-c87b714e19d3@google.com> Subject: [PATCH v5 01/18] mm/page_alloc: rename ALLOC_TRYLOCK -> ALLOC_NOLOCK From: Brendan Jackman To: Andrew Morton , Vlastimil Babka , Suren Baghdasaryan , Michal Hocko , Johannes Weiner , Zi Yan , Muchun Song , Oscar Salvador , David Hildenbrand , Lorenzo Stoakes , "Liam R. Howlett" , Mike Rapoport , Matthew Brost , Joshua Hahn , Rakie Kim , Byungchul Park , Ying Huang , Alistair Popple , Hao Li , Christoph Lameter , David Rientjes , Roman Gushchin , Sebastian Andrzej Siewior , Clark Williams , Steven Rostedt Cc: "Harry Yoo (Oracle)" , Gregory Price , Johannes Weiner , Alexei Starovoitov , Matthew Wilcox , Hao Ge , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-rt-devel@lists.linux.dev, derkling@google.com, reijiw@google.com, Brendan Jackman , Yosry Ahmed Content-Type: text/plain; charset="utf-8" It's confusing that the function is called "nolock" but the flag is called "trylock", align them. The function's terminology is more visible and has more mindshare so use that. Suggested-by: "Vlastimil Babka (SUSE)" Link: https://lore.kernel.org/linux-mm/2399b3ad-4eac-4a14-94c3-27e9f07972a1@kernel.org/ Reviewed-by: Suren Baghdasaryan Reviewed-by: Harry Yoo (Oracle) Reviewed-by: Vlastimil Babka (SUSE) Signed-off-by: Brendan Jackman --- mm/internal.h | 2 +- mm/page_alloc.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/mm/internal.h b/mm/internal.h index fa4fb69444ecd..a2b09a13735bf 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -1480,7 +1480,7 @@ unsigned int reclaim_clean_pages_from_list(struct zone *zone, #define ALLOC_NOFRAGMENT 0x0 #endif #define ALLOC_HIGHATOMIC 0x200 /* Allows access to MIGRATE_HIGHATOMIC */ -#define ALLOC_TRYLOCK 0x400 /* Only use spin_trylock in allocation path */ +#define ALLOC_NOLOCK 0x400 /* Only use spin_trylock in allocation path */ #define ALLOC_KSWAPD 0x800 /* allow waking of kswapd, __GFP_KSWAPD_RECLAIM set */ /* Flags that allow allocations below the min watermark. */ diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 762d9b6bc792f..6004fe6583d47 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -2530,7 +2530,7 @@ static int rmqueue_bulk(struct zone *zone, unsigned int order, unsigned long flags; int i; - if (unlikely(alloc_flags & ALLOC_TRYLOCK)) { + if (unlikely(alloc_flags & ALLOC_NOLOCK)) { if (!spin_trylock_irqsave(&zone->lock, flags)) return 0; } else { @@ -3218,7 +3218,7 @@ struct page *rmqueue_buddy(struct zone *preferred_zone, struct zone *zone, do { page = NULL; - if (unlikely(alloc_flags & ALLOC_TRYLOCK)) { + if (unlikely(alloc_flags & ALLOC_NOLOCK)) { if (!spin_trylock_irqsave(&zone->lock, flags)) return NULL; } else { @@ -5059,7 +5059,7 @@ static inline bool prepare_alloc_pages(gfp_t gfp_mask, unsigned int order, * Don't invoke should_fail logic, since it may call * get_random_u32() and printk() which need to spin_lock. */ - if (!(*alloc_flags & ALLOC_TRYLOCK) && + if (!(*alloc_flags & ALLOC_NOLOCK) && should_fail_alloc_page(gfp_mask, order)) return false; @@ -7804,7 +7804,7 @@ static bool cond_accept_memory(struct zone *zone, unsigned int order, return false; /* Bailout, since try_to_accept_memory_one() needs to take a lock */ - if (alloc_flags & ALLOC_TRYLOCK) + if (alloc_flags & ALLOC_NOLOCK) return false; wmark = promo_wmark_pages(zone); @@ -7896,7 +7896,7 @@ struct page *alloc_frozen_pages_nolock_noprof(gfp_t gfp_flags, int nid, unsigned */ gfp_t alloc_gfp = __GFP_NOWARN | __GFP_ZERO | __GFP_NOMEMALLOC | __GFP_COMP | gfp_flags; - unsigned int alloc_flags = ALLOC_TRYLOCK; + unsigned int alloc_flags = ALLOC_NOLOCK; struct alloc_context ac = { }; struct page *page; -- 2.54.0