linux-doc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] docs: core-api/gfp_mask-from-fs-io: indicate that vmalloc supports GFP_NOFS/GFP_NOIO
@ 2024-11-19  9:39 Pavel Tikhomirov
  2024-11-19  9:51 ` Michal Hocko
  2024-11-22 17:43 ` Jonathan Corbet
  0 siblings, 2 replies; 3+ messages in thread
From: Pavel Tikhomirov @ 2024-11-19  9:39 UTC (permalink / raw)
  To: Jonathan Corbet; +Cc: linux-doc, linux-kernel, Michal Hocko, Pavel Tikhomirov

After the commit 451769ebb7e79 ("mm/vmalloc: alloc GFP_NO{FS,IO} for
vmalloc") in v5.17 it is now safe to use GFP_NOFS/GFP_NOIO flags
in [k]vmalloc, let's reflect it in documentation.

Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
---
 .../core-api/gfp_mask-from-fs-io.rst          | 20 ++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/Documentation/core-api/gfp_mask-from-fs-io.rst b/Documentation/core-api/gfp_mask-from-fs-io.rst
index e7c32a8de126a..858b2fbcb36c7 100644
--- a/Documentation/core-api/gfp_mask-from-fs-io.rst
+++ b/Documentation/core-api/gfp_mask-from-fs-io.rst
@@ -55,14 +55,16 @@ scope.
 What about __vmalloc(GFP_NOFS)
 ==============================
 
-vmalloc doesn't support GFP_NOFS semantic because there are hardcoded
-GFP_KERNEL allocations deep inside the allocator which are quite non-trivial
-to fix up. That means that calling ``vmalloc`` with GFP_NOFS/GFP_NOIO is
-almost always a bug. The good news is that the NOFS/NOIO semantic can be
-achieved by the scope API.
+Since v5.17, and specifically after the commit 451769ebb7e79 ("mm/vmalloc:
+alloc GFP_NO{FS,IO} for vmalloc"), GFP_NOFS/GFP_NOIO are now supported in
+``[k]vmalloc`` by implicitly using scope API.
+
+In earlier kernels ``vmalloc`` didn't support GFP_NOFS semantic because there
+were hardcoded GFP_KERNEL allocations deep inside the allocator. That means
+that calling ``vmalloc`` with GFP_NOFS/GFP_NOIO was almost always a bug.
 
 In the ideal world, upper layers should already mark dangerous contexts
-and so no special care is required and vmalloc should be called without
-any problems. Sometimes if the context is not really clear or there are
-layering violations then the recommended way around that is to wrap ``vmalloc``
-by the scope API with a comment explaining the problem.
+and so no special care is required and ``vmalloc`` should be called without any
+problems. Sometimes if the context is not really clear or there are layering
+violations then the recommended way around that (on pre-v5.17 kernels) is to
+wrap ``vmalloc`` by the scope API with a comment explaining the problem.
-- 
2.47.0


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

* Re: [PATCH] docs: core-api/gfp_mask-from-fs-io: indicate that vmalloc supports GFP_NOFS/GFP_NOIO
  2024-11-19  9:39 [PATCH] docs: core-api/gfp_mask-from-fs-io: indicate that vmalloc supports GFP_NOFS/GFP_NOIO Pavel Tikhomirov
@ 2024-11-19  9:51 ` Michal Hocko
  2024-11-22 17:43 ` Jonathan Corbet
  1 sibling, 0 replies; 3+ messages in thread
From: Michal Hocko @ 2024-11-19  9:51 UTC (permalink / raw)
  To: Pavel Tikhomirov; +Cc: Jonathan Corbet, linux-doc, linux-kernel

On Tue 19-11-24 17:39:01, Pavel Tikhomirov wrote:
> After the commit 451769ebb7e79 ("mm/vmalloc: alloc GFP_NO{FS,IO} for
> vmalloc") in v5.17 it is now safe to use GFP_NOFS/GFP_NOIO flags
> in [k]vmalloc, let's reflect it in documentation.
> 
> Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>

Acked-by: Michal Hocko <mhocko@suse.com>

Thanks!

> ---
>  .../core-api/gfp_mask-from-fs-io.rst          | 20 ++++++++++---------
>  1 file changed, 11 insertions(+), 9 deletions(-)
> 
> diff --git a/Documentation/core-api/gfp_mask-from-fs-io.rst b/Documentation/core-api/gfp_mask-from-fs-io.rst
> index e7c32a8de126a..858b2fbcb36c7 100644
> --- a/Documentation/core-api/gfp_mask-from-fs-io.rst
> +++ b/Documentation/core-api/gfp_mask-from-fs-io.rst
> @@ -55,14 +55,16 @@ scope.
>  What about __vmalloc(GFP_NOFS)
>  ==============================
>  
> -vmalloc doesn't support GFP_NOFS semantic because there are hardcoded
> -GFP_KERNEL allocations deep inside the allocator which are quite non-trivial
> -to fix up. That means that calling ``vmalloc`` with GFP_NOFS/GFP_NOIO is
> -almost always a bug. The good news is that the NOFS/NOIO semantic can be
> -achieved by the scope API.
> +Since v5.17, and specifically after the commit 451769ebb7e79 ("mm/vmalloc:
> +alloc GFP_NO{FS,IO} for vmalloc"), GFP_NOFS/GFP_NOIO are now supported in
> +``[k]vmalloc`` by implicitly using scope API.
> +
> +In earlier kernels ``vmalloc`` didn't support GFP_NOFS semantic because there
> +were hardcoded GFP_KERNEL allocations deep inside the allocator. That means
> +that calling ``vmalloc`` with GFP_NOFS/GFP_NOIO was almost always a bug.
>  
>  In the ideal world, upper layers should already mark dangerous contexts
> -and so no special care is required and vmalloc should be called without
> -any problems. Sometimes if the context is not really clear or there are
> -layering violations then the recommended way around that is to wrap ``vmalloc``
> -by the scope API with a comment explaining the problem.
> +and so no special care is required and ``vmalloc`` should be called without any
> +problems. Sometimes if the context is not really clear or there are layering
> +violations then the recommended way around that (on pre-v5.17 kernels) is to
> +wrap ``vmalloc`` by the scope API with a comment explaining the problem.
> -- 
> 2.47.0

-- 
Michal Hocko
SUSE Labs

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

* Re: [PATCH] docs: core-api/gfp_mask-from-fs-io: indicate that vmalloc supports GFP_NOFS/GFP_NOIO
  2024-11-19  9:39 [PATCH] docs: core-api/gfp_mask-from-fs-io: indicate that vmalloc supports GFP_NOFS/GFP_NOIO Pavel Tikhomirov
  2024-11-19  9:51 ` Michal Hocko
@ 2024-11-22 17:43 ` Jonathan Corbet
  1 sibling, 0 replies; 3+ messages in thread
From: Jonathan Corbet @ 2024-11-22 17:43 UTC (permalink / raw)
  To: Pavel Tikhomirov; +Cc: linux-doc, linux-kernel, Michal Hocko, Pavel Tikhomirov

Pavel Tikhomirov <ptikhomirov@virtuozzo.com> writes:

> After the commit 451769ebb7e79 ("mm/vmalloc: alloc GFP_NO{FS,IO} for
> vmalloc") in v5.17 it is now safe to use GFP_NOFS/GFP_NOIO flags
> in [k]vmalloc, let's reflect it in documentation.
>
> Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
> ---
>  .../core-api/gfp_mask-from-fs-io.rst          | 20 ++++++++++---------
>  1 file changed, 11 insertions(+), 9 deletions(-)

Applied, thanks.

jon

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

end of thread, other threads:[~2024-11-22 17:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-19  9:39 [PATCH] docs: core-api/gfp_mask-from-fs-io: indicate that vmalloc supports GFP_NOFS/GFP_NOIO Pavel Tikhomirov
2024-11-19  9:51 ` Michal Hocko
2024-11-22 17:43 ` 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).