Lines Matching full:memory
4 Memory Allocation Guide
7 Linux provides a variety of APIs for memory allocation. You can
14 Most of the memory allocation APIs use GFP flags to express how that
15 memory should be allocated. The GFP acronym stands for "get free
16 pages", the underlying memory allocation function.
19 makes the question "How should I allocate memory?" not that easy to
32 The GFP flags control the allocators behavior. They tell what memory
34 memory, whether the memory can be accessed by the userspace etc. The
39 * Most of the time ``GFP_KERNEL`` is what you need. Memory for the
40 kernel data structures, DMAable memory, inode cache, all these and
43 direct reclaim may be triggered under memory pressure; the calling
47 IO or filesystem operations. Consequently, under memory pressure
50 * If you think that accessing memory reserves is justified and the kernel
60 ``GFP_HIGHUSER_MOVABLE`` does not require that allocated memory
64 ``GFP_HIGHUSER`` means that the allocated memory is not movable,
69 ``GFP_USER`` means that the allocated memory is not movable and it
74 prevent recursion deadlocks caused by direct memory reclaim calling
81 used to ensure that the allocated memory is accessible by hardware
87 Selecting memory allocator
90 The most straightforward way to allocate memory is to use a function
92 best to use routines that set memory to zero, like
93 :c:func:`kzalloc`. If you need to allocate memory for an array, there
107 allocator. The memory allocated by `vmalloc` and related functions is
112 derivatives. It will try to allocate memory with `kmalloc` and if the
116 `kvmalloc` may return memory that is not physically contiguous.
124 allocate memory from that cache.
126 When the allocated memory is no longer needed it must be freed. You
127 can use :c:func:`kvfree` for the memory allocated with `kmalloc`,