Skip to content

Commit 21e5001

Browse files
SnorchJonathan Corbet
authored andcommitted
docs: core-api/gfp_mask-from-fs-io: indicate that vmalloc supports GFP_NOFS/GFP_NOIO
After the commit 451769e ("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 <[email protected]> Acked-by: Michal Hocko <[email protected]> Signed-off-by: Jonathan Corbet <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 9e6c587 commit 21e5001

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

Documentation/core-api/gfp_mask-from-fs-io.rst

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,16 @@ scope.
5555
What about __vmalloc(GFP_NOFS)
5656
==============================
5757

58-
vmalloc doesn't support GFP_NOFS semantic because there are hardcoded
59-
GFP_KERNEL allocations deep inside the allocator which are quite non-trivial
60-
to fix up. That means that calling ``vmalloc`` with GFP_NOFS/GFP_NOIO is
61-
almost always a bug. The good news is that the NOFS/NOIO semantic can be
62-
achieved by the scope API.
58+
Since v5.17, and specifically after the commit 451769ebb7e79 ("mm/vmalloc:
59+
alloc GFP_NO{FS,IO} for vmalloc"), GFP_NOFS/GFP_NOIO are now supported in
60+
``[k]vmalloc`` by implicitly using scope API.
61+
62+
In earlier kernels ``vmalloc`` didn't support GFP_NOFS semantic because there
63+
were hardcoded GFP_KERNEL allocations deep inside the allocator. That means
64+
that calling ``vmalloc`` with GFP_NOFS/GFP_NOIO was almost always a bug.
6365

6466
In the ideal world, upper layers should already mark dangerous contexts
65-
and so no special care is required and vmalloc should be called without
66-
any problems. Sometimes if the context is not really clear or there are
67-
layering violations then the recommended way around that is to wrap ``vmalloc``
68-
by the scope API with a comment explaining the problem.
67+
and so no special care is required and ``vmalloc`` should be called without any
68+
problems. Sometimes if the context is not really clear or there are layering
69+
violations then the recommended way around that (on pre-v5.17 kernels) is to
70+
wrap ``vmalloc`` by the scope API with a comment explaining the problem.

0 commit comments

Comments
 (0)