summaryrefslogtreecommitdiffstats
path: root/Documentation/process
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2019-03-30 10:25:03 -0700
committerJonathan Corbet <corbet@lwn.net>2019-04-01 14:58:46 -0600
commitbba757d8578ff65b5168f6420552fbba3c159774 (patch)
treed08edd993cb190ac99b568131010ab7f7a212277 /Documentation/process
parent0663a0588440e6f3d41667287b6f001161d2d7c7 (diff)
downloadlinux-bba757d8578ff65b5168f6420552fbba3c159774.tar.gz
linux-bba757d8578ff65b5168f6420552fbba3c159774.tar.bz2
linux-bba757d8578ff65b5168f6420552fbba3c159774.zip
coding-style.rst: Generic alloc functions do not need OOM logging
Generic allocation functions already emit a dump_stack() so additional error logging isn't useful. Document it as such and add a reference to the allocation API. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'Documentation/process')
-rw-r--r--Documentation/process/coding-style.rst6
1 files changed, 5 insertions, 1 deletions
diff --git a/Documentation/process/coding-style.rst b/Documentation/process/coding-style.rst
index 8ea913e99fa1..fa864a51e6ea 100644
--- a/Documentation/process/coding-style.rst
+++ b/Documentation/process/coding-style.rst
@@ -843,7 +843,8 @@ used.
The kernel provides the following general purpose memory allocators:
kmalloc(), kzalloc(), kmalloc_array(), kcalloc(), vmalloc(), and
vzalloc(). Please refer to the API documentation for further information
-about them.
+about them. :ref:`Documentation/core-api/memory-allocation.rst
+<memory_allocation>`
The preferred form for passing a size of a struct is the following:
@@ -874,6 +875,9 @@ The preferred form for allocating a zeroed array is the following:
Both forms check for overflow on the allocation size n * sizeof(...),
and return NULL if that occurred.
+These generic allocation functions all emit a stack dump on failure when used
+without __GFP_NOWARN so there is no use in emitting an additional failure
+message when NULL is returned.
15) The inline disease
----------------------