summaryrefslogtreecommitdiffstats
path: root/include/linux/slab.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/slab.h')
-rw-r--r--include/linux/slab.h55
1 files changed, 27 insertions, 28 deletions
diff --git a/include/linux/slab.h b/include/linux/slab.h
index 6d9bd6fc0c57..11b45f7ae405 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -486,48 +486,47 @@ static __always_inline void *kmalloc_large(size_t size, gfp_t flags)
486 * kmalloc is the normal method of allocating memory 486 * kmalloc is the normal method of allocating memory
487 * for objects smaller than page size in the kernel. 487 * for objects smaller than page size in the kernel.
488 * 488 *
489 * The @flags argument may be one of: 489 * The @flags argument may be one of the GFP flags defined at
490 * include/linux/gfp.h and described at
491 * :ref:`Documentation/core-api/mm-api.rst <mm-api-gfp-flags>`
490 * 492 *
491 * %GFP_USER - Allocate memory on behalf of user. May sleep. 493 * The recommended usage of the @flags is described at
494 * :ref:`Documentation/core-api/memory-allocation.rst <memory-allocation>`
492 * 495 *
493 * %GFP_KERNEL - Allocate normal kernel ram. May sleep. 496 * Below is a brief outline of the most useful GFP flags
494 * 497 *
495 * %GFP_ATOMIC - Allocation will not sleep. May use emergency pools. 498 * %GFP_KERNEL
496 * For example, use this inside interrupt handlers. 499 * Allocate normal kernel ram. May sleep.
497 * 500 *
498 * %GFP_HIGHUSER - Allocate pages from high memory. 501 * %GFP_NOWAIT
502 * Allocation will not sleep.
499 * 503 *
500 * %GFP_NOIO - Do not do any I/O at all while trying to get memory. 504 * %GFP_ATOMIC
505 * Allocation will not sleep. May use emergency pools.
501 * 506 *
502 * %GFP_NOFS - Do not make any fs calls while trying to get memory. 507 * %GFP_HIGHUSER
503 * 508 * Allocate memory from high memory on behalf of user.
504 * %GFP_NOWAIT - Allocation will not sleep.
505 *
506 * %__GFP_THISNODE - Allocate node-local memory only.
507 *
508 * %GFP_DMA - Allocation suitable for DMA.
509 * Should only be used for kmalloc() caches. Otherwise, use a
510 * slab created with SLAB_DMA.
511 * 509 *
512 * Also it is possible to set different flags by OR'ing 510 * Also it is possible to set different flags by OR'ing
513 * in one or more of the following additional @flags: 511 * in one or more of the following additional @flags:
514 * 512 *
515 * %__GFP_HIGH - This allocation has high priority and may use emergency pools. 513 * %__GFP_HIGH
516 * 514 * This allocation has high priority and may use emergency pools.
517 * %__GFP_NOFAIL - Indicate that this allocation is in no way allowed to fail
518 * (think twice before using).
519 * 515 *
520 * %__GFP_NORETRY - If memory is not immediately available, 516 * %__GFP_NOFAIL
521 * then give up at once. 517 * Indicate that this allocation is in no way allowed to fail
518 * (think twice before using).
522 * 519 *
523 * %__GFP_NOWARN - If allocation fails, don't issue any warnings. 520 * %__GFP_NORETRY
521 * If memory is not immediately available,
522 * then give up at once.
524 * 523 *
525 * %__GFP_RETRY_MAYFAIL - Try really hard to succeed the allocation but fail 524 * %__GFP_NOWARN
526 * eventually. 525 * If allocation fails, don't issue any warnings.
527 * 526 *
528 * There are other flags available as well, but these are not intended 527 * %__GFP_RETRY_MAYFAIL
529 * for general use, and so are not documented here. For a full list of 528 * Try really hard to succeed the allocation but fail
530 * potential flags, always refer to linux/gfp.h. 529 * eventually.
531 */ 530 */
532static __always_inline void *kmalloc(size_t size, gfp_t flags) 531static __always_inline void *kmalloc(size_t size, gfp_t flags)
533{ 532{