linux-doc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] docs/core-api: memory-allocation: GFP_NOWAIT doesn't need __GFP_NOWARN
@ 2024-07-29 14:01 Dave Martin
  2024-07-29 14:22 ` Matthew Wilcox
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Dave Martin @ 2024-07-29 14:01 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-doc, Jonathan Corbet, Matthew Wilcox, Mike Rapoport

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>

---

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

diff --git a/Documentation/core-api/memory-allocation.rst b/Documentation/core-api/memory-allocation.rst
index 8b84eb4bdae7..0f19dd524323 100644
--- a/Documentation/core-api/memory-allocation.rst
+++ b/Documentation/core-api/memory-allocation.rst
@@ -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
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] docs/core-api: memory-allocation: GFP_NOWAIT doesn't need __GFP_NOWARN
  2024-07-29 14:01 [PATCH] docs/core-api: memory-allocation: GFP_NOWAIT doesn't need __GFP_NOWARN Dave Martin
@ 2024-07-29 14:22 ` Matthew Wilcox
  2024-07-29 15:49 ` Mike Rapoport
  2024-07-29 21:11 ` Jonathan Corbet
  2 siblings, 0 replies; 4+ messages in thread
From: Matthew Wilcox @ 2024-07-29 14:22 UTC (permalink / raw)
  To: Dave Martin; +Cc: linux-kernel, linux-doc, Jonathan Corbet, Mike Rapoport

On Mon, Jul 29, 2024 at 03:01:27PM +0100, Dave Martin wrote:
> 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>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] docs/core-api: memory-allocation: GFP_NOWAIT doesn't need __GFP_NOWARN
  2024-07-29 14:01 [PATCH] docs/core-api: memory-allocation: GFP_NOWAIT doesn't need __GFP_NOWARN Dave Martin
  2024-07-29 14:22 ` Matthew Wilcox
@ 2024-07-29 15:49 ` Mike Rapoport
  2024-07-29 21:11 ` Jonathan Corbet
  2 siblings, 0 replies; 4+ messages in thread
From: Mike Rapoport @ 2024-07-29 15:49 UTC (permalink / raw)
  To: Dave Martin; +Cc: linux-kernel, linux-doc, Jonathan Corbet, Matthew Wilcox

On Mon, Jul 29, 2024 at 03:01:27PM +0100, Dave Martin wrote:
> 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>

Acked-by: Mike Rapoport (Microsoft) <rppt@kernel.org>

> ---
> 
> 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(-)
> 
> diff --git a/Documentation/core-api/memory-allocation.rst b/Documentation/core-api/memory-allocation.rst
> index 8b84eb4bdae7..0f19dd524323 100644
> --- a/Documentation/core-api/memory-allocation.rst
> +++ b/Documentation/core-api/memory-allocation.rst
> @@ -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
> -- 
> 2.34.1
> 
> 

-- 
Sincerely yours,
Mike.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] docs/core-api: memory-allocation: GFP_NOWAIT doesn't need __GFP_NOWARN
  2024-07-29 14:01 [PATCH] docs/core-api: memory-allocation: GFP_NOWAIT doesn't need __GFP_NOWARN Dave Martin
  2024-07-29 14:22 ` Matthew Wilcox
  2024-07-29 15:49 ` Mike Rapoport
@ 2024-07-29 21:11 ` Jonathan Corbet
  2 siblings, 0 replies; 4+ messages in thread
From: Jonathan Corbet @ 2024-07-29 21:11 UTC (permalink / raw)
  To: Dave Martin, linux-kernel; +Cc: linux-doc, Matthew Wilcox, Mike Rapoport

Dave Martin <Dave.Martin@arm.com> writes:

> 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>
>
> ---
>
> 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(-)
>
> diff --git a/Documentation/core-api/memory-allocation.rst b/Documentation/core-api/memory-allocation.rst
> index 8b84eb4bdae7..0f19dd524323 100644
> --- a/Documentation/core-api/memory-allocation.rst
> +++ b/Documentation/core-api/memory-allocation.rst
> @@ -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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-07-29 21:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-29 14:01 [PATCH] docs/core-api: memory-allocation: GFP_NOWAIT doesn't need __GFP_NOWARN Dave Martin
2024-07-29 14:22 ` Matthew Wilcox
2024-07-29 15:49 ` Mike Rapoport
2024-07-29 21:11 ` Jonathan Corbet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).