Lines Matching +full:4 +full:kb +full:- +full:page

1 // SPDX-License-Identifier: GPL-2.0-only
13 #include "memory-alloc.h"
38 * @flag_ptr: Location of the allocation-allowed flag
71 * performance-critical stage for us, so a linked list should be fine.
113 memory_stats.kmalloc_blocks--; in remove_kmalloc_block()
114 memory_stats.kmalloc_bytes -= size; in remove_kmalloc_block()
123 block->next = memory_stats.vmalloc_list; in add_vmalloc_block()
126 memory_stats.vmalloc_bytes += block->size; in add_vmalloc_block()
140 block_ptr = &block->next) { in remove_vmalloc_block()
141 if (block->ptr == ptr) { in remove_vmalloc_block()
142 *block_ptr = block->next; in remove_vmalloc_block()
143 memory_stats.vmalloc_blocks--; in remove_vmalloc_block()
144 memory_stats.vmalloc_bytes -= block->size; in remove_vmalloc_block()
171 * Linux memory page map can become so fragmented that kmalloc will not give us a 32KB chunk. We
172 * have used vmalloc as a backup to kmalloc in the past, and a follow-up vmalloc of 32KB will work.
175 * The kmalloc/vmalloc boundary is set at 4KB, and kmalloc gets the 4KB requests. There is no
176 * strong reason for favoring either kmalloc or vmalloc for 4KB requests, except that tracking
178 * boundary results in 132 vmalloc calls. Using vmalloc for requests of exactly 4KB results in an
205 * freeing memory such as compaction (which removes fragmentation) and page-out. There is in vdo_allocate_memory()
210 * The caller must handle failure, but can reasonably do so by failing a higher-level in vdo_allocate_memory()
220 return -EINVAL; in vdo_allocate_memory()
236 * no page available. A short sleep may allow the page reclaimer to in vdo_allocate_memory()
237 * free a page. in vdo_allocate_memory()
251 * are no pages available. A short sleep may allow the page reclaimer in vdo_allocate_memory()
254 * For larger allocations, the page_alloc code is racing against the page in vdo_allocate_memory()
255 * reclaimer. If the page reclaimer can stay ahead of page_alloc, the in vdo_allocate_memory()
256 * __vmalloc will succeed. But if page_alloc overtakes the page reclaimer, in vdo_allocate_memory()
264 if (jiffies_to_msecs(jiffies - start_time) > 1000) { in vdo_allocate_memory()
276 block->ptr = p; in vdo_allocate_memory()
277 block->size = PAGE_ALIGN(size); in vdo_allocate_memory()
288 size, what, jiffies_to_msecs(jiffies - start_time)); in vdo_allocate_memory()
289 return -ENOMEM; in vdo_allocate_memory()