Skip to contentSkip to conversation

docs/core-api: memory-allocation: GFP_NOWAIT doesn't need __GFP_NOWARN

PATCH Applied Dave Martin 4 participants 4 messages Jul 29, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 docs/core-api: memory-allocation: GFP_NOWAIT doesn't need __GFP_NOWARN

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")

---

Based on: v6.11-rc1

This change also evaporates the apparent typo of __GFP_NOWARN without the underscores in the documentation, but that doesn't really feel like it merits a dedicated patch.

Not sure if this really merits a Fixes tag, but the docmuentation update might as well be picked into trees that have the corresponding code change.

---
 Documentation/core-api/memory-allocation.rst | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
Documentation/core-api/memory-allocation.rst +3 -2
index 8b84eb4bdae7..0f19dd524323 100644
@@ -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

base-commit: 8400291e289ee6b2bf9779ff1c83a291501f017b

Signature · 1 line
2.34.1
reviewer Acked-by on v1 1/1
#2 lore raw
In reply to Dave Martin
Quoted 8 lines · Dave Martin

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")
Quoted 38 lines

---

Based on: v6.11-rc1

This change also evaporates the apparent typo of __GFP_NOWARN without the underscores in the documentation, but that doesn't really feel like it merits a dedicated patch.

Not sure if this really merits a Fixes tag, but the docmuentation update might as well be picked into trees that have the corresponding code change.

---
 Documentation/core-api/memory-allocation.rst | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
Documentation/core-api/memory-allocation.rst +3 -2
index 8b84eb4bdae7..0f19dd524323 100644
@@ -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

base-commit: 8400291e289ee6b2bf9779ff1c83a291501f017b

Signature · 1 line
2.34.1
Signature · 2 lines
Sincerely yours,
Mike.
maintainer Applied
#3 lore raw
In reply to Dave Martin
Quoted 30 lines · Dave Martin

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")

---

Based on: v6.11-rc1

This change also evaporates the apparent typo of __GFP_NOWARN without the underscores in the documentation, but that doesn't really feel like it merits a dedicated patch.

Not sure if this really merits a Fixes tag, but the docmuentation update might as well be picked into trees that have the corresponding code change.

---
 Documentation/core-api/memory-allocation.rst | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
Documentation/core-api/memory-allocation.rst +0 -0
index 8b84eb4bdae7..0f19dd524323 100644

Documentation/core-api/memory-allocation.rst here we briefly outline their recommended usage: · line 51

Quoted 9 lines
Documentation/core-api/memory-allocation.rst +3 -2
@@ -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

Applied, thanks.

jon