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 AE0A040803F for ; Mon, 29 Jun 2026 13:12:24 +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=1782738746; cv=none; b=Bl6+Xmny5NaG9mJElQhvZJYJGnhRicm66OEdCxkumiDYLvuGql5PTIBmZjHcu6BSBFPIzovBRzIk8hpnVMhUZoDl9d8VTQtlmw207YhcfkALBtrpR07D4jGdrvDP+HiYf1iBgtf2Xnu0uZs8TmGgUnjlFMidf9xGK3nU8vGt6wQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782738746; c=relaxed/simple; bh=mjbpH/Ax6zXqST/jfztAcWFWimam01qcy6f291QHYyk=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=tWjU4spmEfvxYuSVy/wHgS/7Id9JjLTvZJTQ2o5JHaPC54bwW8m135RJ+7jJhDYpUHJnzfame7q+vLGQjU0LioqxOndi05v6mO6XVufW1l8HOy892tnAcxlXUPOer59GlpPn2it0/lJ0lINSIBQhKVK8/tsgNV4dGO4Updli+Tc= 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=AW5kqLsw; 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="AW5kqLsw" Received: by mail-wm1-f74.google.com with SMTP id 5b1f17b1804b1-4924207e640so28483945e9.3 for ; Mon, 29 Jun 2026 06:12:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1782738743; x=1783343543; 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=LAoUsjWph/3flUCSB7flZmzGzWVdy8wS9hni21TX4N8=; b=AW5kqLswUm3KDdXnHVNb24gN+HQ0FAMtMhn7yxM5mEvpvAiG6WznYHspe+wLgC1ZvO UG/17wkIk831yln6dD0fb1OvkhgWWPF2QSvEF6z8Id0DyJ5BOQ18nrrcJXT1E6yhEBJO 5xWF4oc/UW4zgz9Rj8ZtIACFODBVJM49EGJlg85QoWnSKs/zHk9y2jcGaVsQOXh0v7Qj szhwK/zKRo4QHv7ap+L+Iy2Re6P/J7w677tlEfIInIlKoXZe3zFWI9wySwmB/A2JAR7Z gHAAqFogtwuvs8RvAZRLKxZRA8HRrevO9zE5WTXYGfkb62VBfMmf63YHwQPuzewEs61F FeMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782738743; x=1783343543; 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=LAoUsjWph/3flUCSB7flZmzGzWVdy8wS9hni21TX4N8=; b=YXGFqPtBd8IT1Lay/CtXnzA6RSqVdxJXJhmtpO8Wi8+MI/zjUBqUZaB7MCGF/KwmhV bdJOg7aP7R1jPv2D+6VYEHsYk/GzNSGM7gE975Ft+XZ+CzJS8YFLAMtxdPg7PtqFQzVI lOynB57xOCm6L4xINmI3m+kZ3afvifiCVQgBiSWaYV0cv98ohmsgIn1LhGqAwQApgg69 5dgqY4bIXaIXzPpQPaeqQyhnqoHEHbmFcBXjP7/uZUVnCRcWx4nqvjXjYvIGl9ydv8wu l+O7BZT+RayxO07p1V+JtlGuCuka+yTmXge+zzw2SSLTY/mv5hVi/coGs8W2lNGCZSot rpKA== X-Forwarded-Encrypted: i=1; AFNElJ9jKJevSzbOX005BCOaI1e4eu6JzQbVienciYc2C9O/g9z+dK4k8G1F8QfM9t+tezRAEQiGejUKDjDRdXA=@vger.kernel.org X-Gm-Message-State: AOJu0YyLCJvnYnRr5FY9dMfFMeDMVv7HJLZ7G6+zFkwyqgfyiTqI9EdM Be7ld2BtvXTiD/dWG9eTLM0Cp0ZmJ5bFLkIFy6K3rA/aWABd5NSSAtFpNwiwsf1bIz1F4OgYPg9 9/J8+mWhFz5qaCw== X-Received: from wmjq19.prod.google.com ([2002:a7b:ce93:0:b0:492:450b:fe7b]) (user=jackmanb job=prod-delivery.src-stubby-dispatcher) by 2002:a05:600c:4e45:b0:492:4948:bfce with SMTP id 5b1f17b1804b1-4926fc45f89mr171546305e9.16.1782738742815; Mon, 29 Jun 2026 06:12:22 -0700 (PDT) Date: Mon, 29 Jun 2026 13:11:55 +0000 In-Reply-To: <20260629-alloc-trylock-v3-0-57bef0eadbc2@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260629-alloc-trylock-v3-0-57bef0eadbc2@google.com> X-Mailer: b4 0.15.2 Message-ID: <20260629-alloc-trylock-v3-6-57bef0eadbc2@google.com> Subject: [PATCH v3 06/16] mm/page_alloc: relax GFP WARN in nolock allocs 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, Brendan Jackman Content-Type: text/plain; charset="utf-8" This WARN forbids setting other flags than __GFP_ACCOUNT but we unconditionally set the ones in gfp_nolock so they are certainly fine for the caller to set. There are other GFP flags that are almost certainly fine to set here; Willy noted GFP_HIGHMEM, GFP_DMA, GFP_MOVABLE and GFP_HARDWALL. But, nolock allocation is rather special, so be conservative to try and ensure we have a chance to think carefully before nontrivial new usecases arise. Suggested-by: Matthew Wilcox Link: https://lore.kernel.org/linux-mm/ajS96fWbG4dzP3u3@casper.infradead.org/ Reviewed-by: Suren Baghdasaryan Signed-off-by: Brendan Jackman --- 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 8d409d075e3e9..9cb3f1665b41b 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -5355,7 +5355,8 @@ struct page *__alloc_frozen_pages_noprof(gfp_t gfp, unsigned int order, return NULL; if (alloc_flags & ALLOC_NOLOCK) { - VM_WARN_ON_ONCE(gfp & ~__GFP_ACCOUNT); + /* Certain other flags could be supported later if needed. */ + VM_WARN_ON_ONCE(gfp & ~(__GFP_ACCOUNT | gfp_nolock)); if (!alloc_trylock_allowed()) return NULL; gfp |= gfp_nolock; -- 2.54.0