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 42B234D2EC8 for ; Thu, 2 Jul 2026 09:49:56 +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=1782985797; cv=none; b=ofPlxwSgUhx72HmbVv8kcUWaNfL1FWGvI4SMvWQcRbzDTmUh+Tde8FafR2047zieHBtIHX2YNrvwr9sAhG38+OvCB5qDgAVo7I0uHwdoyGR+kTfdZJKEQ9v7osD2gS50cjlI/9Pmi8CZbNjCz7NUdsy/2cVDpyKYQ0w4ezKHDng= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782985797; c=relaxed/simple; bh=4JV/dnncChu5h8Yu3gsmWxfntPIFpYV3vfK/cEvVBdg=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=l+t8ppudTL7wj/8zMS35nkop9otdS025VxV38NctLWv1+TzEZZ6wq4c/qK+wZIjP9xC/oki14D+Kp41FACZJfj11M3LthKNGpcRrlHIHRsuy4BTQ9p/FGTSW9P7oA/ROAdmIuYiztMXl9SSD6DS5m6D0uNL+jx/4swf14oDi8xw= 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=uWvt+WgF; 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="uWvt+WgF" Received: by mail-wr1-f73.google.com with SMTP id ffacd0b85a97d-47485fde05aso1145706f8f.0 for ; Thu, 02 Jul 2026 02:49:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1782985795; x=1783590595; 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=uWvt+WgFrQDthIGfB8ztTo3uhsor6mMGdKvn5e+YkoDmXBLUDjCfIOc6VJHTIsKUq9 KK/BrbU/Hp1arWcapYk+pGrYvPZGk/yTNIQkLy/KfxcUHi6wwZraxwy73akXGFct8gto +wZcvaP7CdqniBbAB0o73wHi8sN0Gt/TwQEnMtP1hXBH+GPRuv5mpIrue14FQlbszsUo 7m6B82T4sjAlf1l1w8Xwbj55qVAFKQo7RUsDZfjeH5eH5AWmt/oEFaXwrudImqWSTEWl K9EDirW9LvB6C+x5o+9D9+NosKIpCkIMBroEKAekj4LKjx50tIp65SHNqUB7oOx927Cg iSDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782985795; x=1783590595; 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=qqWW6Uy2mWouZfcg9KugFIvDYljBt81aj0bN9jrRo3KhAK6FwQXbo6Oh/da5+Oaedq SBQ07jVNdjsm4T1y28K1UGw/BuLzoOxaQJ+/rrekHVZBiPKPxTA+X0AdfKsdhTbKA2Gn CFS+oQy9dzxP5wRxl5ESf19YVlpHVEGH0BQerHxTZ1Tz5PaOydWGmKYW/y4eYTbiXckU zevlZu5aIiBKjKC0hdR8YGiSkkHMguPL2Iqro/IaAxgqV/aM+aVhyHbx11zWeBqbIMBz FHOVen0Av/BVkWs3C8xj5I9b1sYIcznm5SHdLQh6Gwgwb+aF7qHSRXsicOyX+eiE50gd D2eA== X-Forwarded-Encrypted: i=1; AFNElJ+A8dPf/jSodGcuee+vizg0Onfd4aGCuQHYn28BFC/qpGQlfNbTpWIKkk5jevxko0YW7JYF7pRaJWI4Dzs=@vger.kernel.org X-Gm-Message-State: AOJu0YxuUFmxh4N1Lqi2uhfz+ePnUDlxxj0zKpRLnaZu9lj2sH6/3tcu MfoW65lhZcKNFpbsu5x7ag/ThOYIYynO3002GnzzM2stJGkrM+4rBwt+IIAzG9WqBH336QlzoA+ 81tyPbQsY2t+2rA== X-Received: from wmim5.prod.google.com ([2002:a7b:cb85:0:b0:490:b1af:78f3]) (user=jackmanb job=prod-delivery.src-stubby-dispatcher) by 2002:a05:600c:6a8e:b0:490:bd66:e523 with SMTP id 5b1f17b1804b1-493c2b7f3bbmr54894255e9.20.1782985794289; Thu, 02 Jul 2026 02:49:54 -0700 (PDT) Date: Thu, 02 Jul 2026 09:49:37 +0000 In-Reply-To: <20260702-alloc-trylock-v4-0-0af8ff387e80@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260702-alloc-trylock-v4-0-0af8ff387e80@google.com> X-Mailer: b4 0.15.2 Message-ID: <20260702-alloc-trylock-v4-6-0af8ff387e80@google.com> Subject: [PATCH v4 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