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
51 * If you think that accessing memory reserves is justified and the kernel
61 ``GFP_HIGHUSER_MOVABLE`` does not require that allocated memory
65 ``GFP_HIGHUSER`` means that the allocated memory is not movable,
70 ``GFP_USER`` means that the allocated memory is not movable and it
75 prevent recursion deadlocks caused by direct memory reclaim calling
82 used to ensure that the allocated memory is accessible by hardware
90 Memory allocations may trigger direct or background reclaim and it is
95 attempt to free memory at all. The most light weight mode which even
97 might deplete the memory and the next user might hit the more aggressive
101 allocation without any attempt to free memory from the current
102 context but can wake kswapd to reclaim memory if the zone is below
109 some portion of memory reserves. Usually used from interrupt/bottom-half
132 Selecting memory allocator
135 The most straightforward way to allocate memory is to use a function
137 routines that set memory to zero, like kzalloc(). If you need to
138 allocate memory for an array, there are kmalloc_array() and kcalloc()
158 request pages from the page allocator. The memory allocated by `vmalloc`
163 try to allocate memory with `kmalloc` and if the allocation fails it
166 documentation. Note that `kvmalloc` may return memory that is not
174 wrappers can allocate memory from that cache.
176 When the allocated memory is no longer needed it must be freed.
185 Memory allocated by `vmalloc` can be freed with `vfree` or `kvfree`.
186 Memory allocated by `kvmalloc` can be freed with `kvfree`.