]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
docs/core-api: memory-allocation: GFP_NOWAIT doesn't need __GFP_NOWARN
authorDave Martin <Dave.Martin@arm.com>
Mon, 29 Jul 2024 14:01:27 +0000 (15:01 +0100)
committerJonathan Corbet <corbet@lwn.net>
Mon, 29 Jul 2024 21:10:25 +0000 (15:10 -0600)
Since v6.8 the definition of GFP_NOWAIT has implied __GFP_NOWARN,
so it is now redundant to add this flag explicitly.

Update the docs to match, and emphasise the need for a fallback
when using GFP_NOWAIT.

Fixes: 16f5dfbc851b ("gfp: include __GFP_NOWARN in GFP_NOWAIT")
Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Acked-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Link: https://lore.kernel.org/r/20240729140127.244606-1-Dave.Martin@arm.com
Documentation/core-api/memory-allocation.rst

index 8b84eb4bdae7fbb31b3b79368bdae62d40fe1612..0f19dd524323942b7530527d6d501cd34297d085 100644 (file)
@@ -45,8 +45,9 @@ here we briefly outline their recommended usage:
   * If the allocation is performed from an atomic context, e.g interrupt
     handler, use ``GFP_NOWAIT``. This flag prevents direct reclaim and
     IO or filesystem operations. Consequently, under memory pressure
-    ``GFP_NOWAIT`` allocation is likely to fail. Allocations which
-    have a reasonable fallback should be using ``GFP_NOWARN``.
+    ``GFP_NOWAIT`` allocation is likely to fail. Users of this flag need
+    to provide a suitable fallback to cope with such failures where
+    appropriate.
   * If you think that accessing memory reserves is justified and the kernel
     will be stressed unless allocation succeeds, you may use ``GFP_ATOMIC``.
   * Untrusted allocations triggered from userspace should be a subject