Skip to content

Commit 04b8e94

Browse files
akpm00torvalds
authored andcommitted
mm/util.c: improve kvfree() kerneldoc
Scooped from an email from Matthew. Cc: Mike Rapoport <[email protected]> Cc: Jonathan Corbet <[email protected]> Cc: Matthew Wilcox <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 7ab660f commit 04b8e94

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

mm/util.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -435,11 +435,14 @@ void *kvmalloc_node(size_t size, gfp_t flags, int node)
435435
EXPORT_SYMBOL(kvmalloc_node);
436436

437437
/**
438-
* kvfree - free memory allocated with kvmalloc
439-
* @addr: pointer returned by kvmalloc
438+
* kvfree() - Free memory.
439+
* @addr: Pointer to allocated memory.
440440
*
441-
* If the memory is allocated from vmalloc area it is freed with vfree().
442-
* Otherwise kfree() is used.
441+
* kvfree frees memory allocated by any of vmalloc(), kmalloc() or kvmalloc().
442+
* It is slightly more efficient to use kfree() or vfree() if you are certain
443+
* that you know which one to use.
444+
*
445+
* Context: Any context except NMI.
443446
*/
444447
void kvfree(const void *addr)
445448
{

0 commit comments

Comments
 (0)