From mboxrd@z Thu Jan 1 00:00:00 1970 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 EFA773D411A for ; Fri, 3 Jul 2026 12:32:30 +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=1783081955; cv=none; b=PquLv6HOI1RewlggxIfHuxytogPCwrX2uvz8Dk60zZAq5lkFnCav7y8xTlPGsr5OwJMC/dPmYXhaW/VevRQUBbfevU/qVO6l+T9N4K/gdkzCzYd6r/1qYDTlzYHvJWdUZ2iHNI8S0TRnQB6wXlwHZkGvAGO0yYLmhn5Mm8lPTTA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783081955; c=relaxed/simple; bh=4JV/dnncChu5h8Yu3gsmWxfntPIFpYV3vfK/cEvVBdg=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=Tzvm7TKXQp0hzd27beX9alxsxSfPXZYxiu/6RNSpHl2PVFL/d3+2unbsRIMp35ad+jGhcA35nsJffOUP9XIgmpYN4SeY48DqkANWaTcq5JzOuPouHTnRW5F4RZgFF+8QkANKgzeUNLzm2g5z8zYswX2ny7d8O01mG9f7c/W1quU= 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=HR3D6JOx; 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="HR3D6JOx" Received: by mail-wr1-f73.google.com with SMTP id ffacd0b85a97d-4773d2405c5so527411f8f.3 for ; Fri, 03 Jul 2026 05:32:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1783081947; x=1783686747; 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=ZSxEwrSlsWzCUsFCp9f9B1Fd4DZM61HmbiQS7KAxRp8=; b=HR3D6JOxBlWgowvzj8xaax87ucYOwzD1f1DXDHlPxDp4mNajiXkN6dbTJvF8onVfKD X2Pvhok3hc/GNtPHfiA/jROvuTnoqpiaM8O1zSpMPpWexJL1Zxz173MiFugNAS9n8Msb Nv/XLyAYgwB5n+/teDEr+KQLiThF4kwW5HIK2Sh1KB7LdUaI6yDK35TXsmVc8rarJFjM 0/fUhzGVHRFAX7zHg3gYWAJ+iDw/OkyjaoBKLsE61PeJhq7Vx2+EvKb9we4RWY+GldAZ wdepSLH32mnBspgywc5WikTyoVA6gbgoAnfTZ3C+HDzVCq8RNCIpOP+ozR3K3sPWGhY1 czbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783081947; x=1783686747; 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=ZSxEwrSlsWzCUsFCp9f9B1Fd4DZM61HmbiQS7KAxRp8=; b=jdcHfBpejUc4vxAUFzzXO2BzZ/2b9Z8G2lioEgRz0idk3DvLgrkiY3QmzEuOMB/+1n pDX1n8YOlCEZElqW6KoXx7JR6FLKTIv/wmf4WhYsjQY7LOx5R+LqZZZinXVHX+st09Lz aD8dXNSG1h94q0r+5c2TEopVZaIzXNX/Z25sMDrD4FCmaPqsN4CgURZDZj9wMp7N8QqA nBYayKJOpclPd++amMerXHOm4ibMnz8r5UBqCGa690AG/RByB+MSse3O30gBKYxzz/b5 DL0VAWoopP4xHsyqHRujRzIFJvwSKEYrMnTPXmM+hf7EVrF+l/yKdYId4jh0WqA4SrPt BnuA== X-Forwarded-Encrypted: i=1; AHgh+RqetJV0K8ARbge2emEwFROowzV40+VmbgX8cd4a4U0s46UOjl/MvfPtMLVRTYguTLhdOZboDQVnYJZ7yjg=@vger.kernel.org X-Gm-Message-State: AOJu0YzZeT4rO2m+qJc+DcCtXsVrRKQMi3KC0nrynf3xAdISA3zLNe7u OnWQENDIQvwBbiEf3TWkdRtAavfQEYchuOiYQ968+8HSdJkT72tZ5ERRKfuQvnOOkszg+wwInZ0 K7fSOLo45W2TzjQ== X-Received: from wrbfi5.prod.google.com ([2002:a05:6000:4405:b0:463:60a:d024]) (user=jackmanb job=prod-delivery.src-stubby-dispatcher) by 2002:a5d:5d0a:0:b0:473:506a:e47c with SMTP id ffacd0b85a97d-4775a7cda27mr16629163f8f.26.1783081946118; Fri, 03 Jul 2026 05:32:26 -0700 (PDT) Date: Fri, 03 Jul 2026 12:31:46 +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-6-c87b714e19d3@google.com> Subject: [PATCH v5 06/18] 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, derkling@google.com, reijiw@google.com, Brendan Jackman , Yosry Ahmed 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 Reviewed-by: Vlastimil Babka (SUSE) Acked-by: Harry Yoo (Oracle) 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 f47a848555077..c2839959d7908 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_nolock_allowed()) return NULL; gfp |= gfp_nolock; -- 2.54.0