From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-f74.google.com (mail-ed1-f74.google.com [209.85.208.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 ADCC9364042 for ; Mon, 22 Jun 2026 10:01:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.74 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782122505; cv=none; b=OuOstDVoi0tRsWUfb3QBR9zDJelB/4wu0pEn9hngTnmKHIj+ZspNvm3hYqqRFBivpvq8PXAQoyYZyADC9zO2NxDFhkrw2bdRtOcmXLSo7E/CHXNdfc3XbnXpUt+/9TUStL4KLnvqi1IFbNL6yWkBG5Ebg5g0uyfQqCIOdMclfRg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782122505; c=relaxed/simple; bh=5N1IHbTh4aGWLCt5X+YQBvX1CjUk4c66onkWMns28ME=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=XdsPIeivXPfPdEaVC+XkfXfNyZYv+C68S54O0kXR40BUw1JiiIH2LJgRHTFbQAcaWP6XHVvEQOdycvPJkWHW3odjUCkwUuc8EkTe9ZKEgFt2hopzA+oAt77Jw7x3uvV4zGQol9r4xZ1NbfwhehaZkpoHzbl5OffoVMIzHPhYR3o= 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=fsYtYVjl; arc=none smtp.client-ip=209.85.208.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="fsYtYVjl" Received: by mail-ed1-f74.google.com with SMTP id 4fb4d7f45d1cf-695b677095eso4285525a12.0 for ; Mon, 22 Jun 2026 03:01:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1782122502; x=1782727302; 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=UneJ0hQ9IswDca+FJXWZCL3Fj/wq6Co0/EBHWSTe0wU=; b=fsYtYVjlG5RFcrXbKjx9Pok+y/qpdl0ArhY/le4GyOZUbmeKh6ujBw5zzBbQmqpMrT t6Zuq7pq5GoeD+v4Xgfu6XgKfSVDXQN93IPFLkyJ5iDGADCkg1uFsHFVxZrB31JlQT0X 9BVmu74T5QEVMIyjesV60Vm2cHJ+q8wfeqP5H5AqaIIeJWfbfdxLitb6g/WyBrYsLV6f Mnj7ySvJZrioYDMEbwd2HC9WcKkK3Z+u45LcwjP2PbJNfIyeUiqjmbBKMUteyEkXzPhB 53nz63+S9WSIaagbzQsBZ5Ts0uOPVpwi8LOY0dAkvXxvSYRliIn8xXVc/cpfiJbDwhWL LBcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782122502; x=1782727302; 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=UneJ0hQ9IswDca+FJXWZCL3Fj/wq6Co0/EBHWSTe0wU=; b=tFaT+6EI8GKUdLWwI5j88jNwW+QMDQ3gIs7fQKl1r/vLOG+N04V3MtAYFTpIiGDHDv HfJ2/UMbkimI/jMOZXYtpi71RjWrFKl+/IuRBeLoo9UWXtreYf/NWuusCs/XiAZ3lgnk DNMwp+2C3HZEV5rvg7Nylz0xxgoHylLUALRCgDiA4AwIBcEUCvZcnEifOL4Yubem6dPG he4bSe+2JVZDMYkCHdP8WSftGIzF9eRW3fMx9oYS05ZFuhIHVldDteVAMa4/uqVEJUUK f0dPxGFa51VCVxTcZwkFZoikSSn0OW57az7Ont6UsJpD97E878snTtqWz+PtfDzWrBqW jBJw== X-Forwarded-Encrypted: i=1; AFNElJ8HcstEcOGhmNO4XPyEavo4Ue1EZpDu8rT9WiPjm1G589Gb0TVBfHte6h+l9xPJPt4mcp/DTBD4u2769hg=@vger.kernel.org X-Gm-Message-State: AOJu0YyQYs5c88HzJaZvzeMWaO2Gqhi/CISdoVlelSl+mcFCF71sgvUg hXYcn/+/e3aGuQ2CDYALOomjGJXxlZ0pvgsUybQtgi96iMaFqEAG9Y5qjllRuF3PNiWDo2LKAKV hnBtteGY4hZ/3uQ== X-Received: from edsn17.prod.google.com ([2002:aa7:c791:0:b0:695:c3e8:f517]) (user=jackmanb job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6402:400f:b0:697:be39:606f with SMTP id 4fb4d7f45d1cf-697be3960f5mr844476a12.11.1782122501844; Mon, 22 Jun 2026 03:01:41 -0700 (PDT) Date: Mon, 22 Jun 2026 10:01:28 +0000 In-Reply-To: <20260622-alloc-trylock-v2-0-31f31367d420@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260622-alloc-trylock-v2-0-31f31367d420@google.com> X-Mailer: b4 0.15.2 Message-ID: <20260622-alloc-trylock-v2-1-31f31367d420@google.com> Subject: [PATCH v2 01/13] 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 , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-rt-devel@lists.linux.dev, Brendan Jackman 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/ 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 181e79f1d6a20..1483a4fcdfce1 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -1475,7 +1475,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 0111cdbdb5321..6c4eb6908bd95 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -2528,7 +2528,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 { @@ -3216,7 +3216,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 { @@ -5042,7 +5042,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; @@ -7786,7 +7786,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); @@ -7878,7 +7878,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