memblock_alloc函数 定义在Linux内核源码的 linux-4.12\mm\memblock.c#1242 位置 ; 代码语言:javascript 代码运行次数:0 运行 AI代码解释 phys_addr_t __initmemblock_alloc(phys_addr_t size,phys_addr_t align){returnmemblock_alloc_base(size,align,MEMBLOCK_ALLOC_ACCESSIBLE);} 源码路径 :linux-4.12\mm\mem...
在memblock_alloc 函数 中 , 调用了 memblock_alloc_base 函数 ; 二、memblock_alloc_base 函数分析 在memblock_alloc_base 函数 中 , 调用了 __memblock_alloc_base 函数 , 目的是 获取一块 可用物理内存 , 如果执行成功 , 则获取的 物...
memblock 的使用期限 从start_kernel->setup_arch->paging_init->bootmem_init->memblock_allow_resize 返回到 kernel_init(进程1) -> free_initmem memblock 相关的函数 都是 用 __init 修饰的, 在free_initmem 的时候会被释放掉所以就再也不能用 memblock_alloc 来申请内存了. 实际上 mm_init 函数执行之...
- ret = memblock_alloc_base_nid(size, align, MEMBLOCK_ALLOC_ACCESSIBLE, - nid, flags); + ret = memblock_alloc_range_nid(size, align, 0, + MEMBLOCK_ALLOC_ACCESSIBLE, nid, flags); if (!ret && (flags & MEMBLOCK_MIRROR)) { flags &= ~MEMBLOCK_MIRROR; @@ -1371,8 +1364,8 @@ phys...
@@ -624,8 +624,14 @@ void __init alloc_irqstack_bootmem(void) softirq_stack[i] = memblock_alloc_node(THREAD_SIZE, THREAD_SIZE, node); + if (!softirq_stack[i]) + panic("%s: Failed to allocate %lu bytes align=%lx nid=%d\n", ...
- nd_pa = __memblock_alloc_base(nd_size, SMP_CACHE_BYTES, - MEMBLOCK_ALLOC_ACCESSIBLE); - if (!nd_pa) { - pr_err("Cannot find %zu bytes in any node (initial node: %d)\n", - nd_size, nid); - return; - } + pr_err("Cannot find %zu bytes in any node (initial node: %d...
arena = memblock_alloc(sizeof(*arena), SMP_CACHE_BYTES); + if (!arena) + panic("%s: Failed to allocate %lu bytes\n", __func__, + sizeof(*arena)); } arena->ptes = memblock_alloc_node(sizeof(*arena), align, nid); @@ -88,12 +91,21 @@ iommu_arena_new_node(int nid, st...
The memblock_alloc_base() function tries to allocate a memory up to the limit specified by its max_addr parameter and panics if the allocation fails. Replace its usage with memblock_phys_alloc_range() and make the callers check the return value and panic in case of error....
if (res) return res; - return memblock_alloc_base(size, align, MEMBLOCK_ALLOC_ACCESSIBLE); + return memblock_alloc_range_nid(size, align, 0, + MEMBLOCK_ALLOC_ACCESSIBLE, + NUMA_NO_NODE, MEMBLOCK_NONE); } /** -- 2.7.4
BUG_ON(!arm_memblock_steal_permitted); phys = memblock_phys_alloc(size, align); + if (!phys) + panic("Failed to steal %pa bytes at %pS\n", + &size, (void *)_RET_IP_); + memblock_free(phys, size); memblock_remove(phys, size); ...