/linux/tools/testing/memblock/tests/ |
H A D | basic_api.c | 4 #include <linux/memblock.h> 17 ASSERT_NE(memblock.memory.regions, NULL); in memblock_initialization_check() 18 ASSERT_EQ(memblock.memory.cnt, 0); in memblock_initialization_check() 19 ASSERT_EQ(memblock.memory.max, EXPECTED_MEMBLOCK_REGIONS); in memblock_initialization_check() 20 ASSERT_EQ(strcmp(memblock.memory.name, "memory"), 0); in memblock_initialization_check() 22 ASSERT_NE(memblock.reserved.regions, NULL); in memblock_initialization_check() 23 ASSERT_EQ(memblock.reserved.cnt, 0); in memblock_initialization_check() 24 ASSERT_EQ(memblock.memory.max, EXPECTED_MEMBLOCK_REGIONS); in memblock_initialization_check() 25 ASSERT_EQ(strcmp(memblock.reserved.name, "reserved"), 0); in memblock_initialization_check() 27 ASSERT_EQ(memblock.bottom_up, false); in memblock_initialization_check() [all …]
|
H A D | alloc_nid_api.c | 66 struct memblock_region *rgn = &memblock.reserved.regions[0]; in alloc_nid_top_down_simple_check() 91 ASSERT_EQ(memblock.reserved.cnt, 1); in alloc_nid_top_down_simple_check() 92 ASSERT_EQ(memblock.reserved.total_size, size); in alloc_nid_top_down_simple_check() 118 struct memblock_region *rgn = &memblock.reserved.regions[0]; in alloc_nid_top_down_end_misaligned_check() 144 ASSERT_EQ(memblock.reserved.cnt, 1); in alloc_nid_top_down_end_misaligned_check() 145 ASSERT_EQ(memblock.reserved.total_size, size); in alloc_nid_top_down_end_misaligned_check() 169 struct memblock_region *rgn = &memblock.reserved.regions[0]; in alloc_nid_exact_address_generic_check() 194 ASSERT_EQ(memblock.reserved.cnt, 1); in alloc_nid_exact_address_generic_check() 195 ASSERT_EQ(memblock.reserved.total_size, size); in alloc_nid_exact_address_generic_check() 221 struct memblock_region *rgn = &memblock.reserved.regions[0]; in alloc_nid_top_down_narrow_range_check() [all …]
|
H A D | alloc_helpers_api.c | 20 struct memblock_region *rgn = &memblock.reserved.regions[0]; in alloc_from_simple_generic_check() 38 ASSERT_EQ(memblock.reserved.cnt, 1); in alloc_from_simple_generic_check() 39 ASSERT_EQ(memblock.reserved.total_size, size); in alloc_from_simple_generic_check() 63 struct memblock_region *rgn = &memblock.reserved.regions[0]; in alloc_from_misaligned_generic_check() 82 ASSERT_EQ(memblock.reserved.cnt, 1); in alloc_from_misaligned_generic_check() 83 ASSERT_EQ(memblock.reserved.total_size, size); in alloc_from_misaligned_generic_check() 110 struct memblock_region *rgn = &memblock.reserved.regions[0]; in alloc_from_top_down_high_addr_check() 127 ASSERT_EQ(memblock.reserved.cnt, 1); in alloc_from_top_down_high_addr_check() 128 ASSERT_EQ(memblock.reserved.total_size, size); in alloc_from_top_down_high_addr_check() 153 struct memblock_region *rgn = &memblock.reserved.regions[0]; in alloc_from_top_down_no_space_above_check() [all …]
|
H A D | alloc_api.c | 26 struct memblock_region *rgn = &memblock.reserved.regions[0]; in alloc_top_down_simple_check() 44 ASSERT_EQ(memblock.reserved.cnt, 1); in alloc_top_down_simple_check() 45 ASSERT_EQ(memblock.reserved.total_size, size); in alloc_top_down_simple_check() 73 struct memblock_region *rgn1 = &memblock.reserved.regions[1]; in alloc_top_down_disjoint_check() 74 struct memblock_region *rgn2 = &memblock.reserved.regions[0]; in alloc_top_down_disjoint_check() 105 ASSERT_EQ(memblock.reserved.cnt, 2); in alloc_top_down_disjoint_check() 106 ASSERT_EQ(memblock.reserved.total_size, total_size); in alloc_top_down_disjoint_check() 125 struct memblock_region *rgn = &memblock.reserved.regions[0]; in alloc_top_down_before_check() 147 ASSERT_EQ(memblock.reserved.cnt, 1); in alloc_top_down_before_check() 148 ASSERT_EQ(memblock.reserved.total_size, total_size); in alloc_top_down_before_check() [all …]
|
H A D | common.c | 30 "memblock function being tested, the name of the test,\n\t\t\t" 41 memset(memblock.memory.regions, 0, in reset_memblock_regions() 42 memblock.memory.cnt * sizeof(struct memblock_region)); in reset_memblock_regions() 43 memblock.memory.cnt = 0; in reset_memblock_regions() 44 memblock.memory.max = INIT_MEMBLOCK_REGIONS; in reset_memblock_regions() 45 memblock.memory.total_size = 0; in reset_memblock_regions() 47 memset(memblock.reserved.regions, 0, in reset_memblock_regions() 48 memblock.reserved.cnt * sizeof(struct memblock_region)); in reset_memblock_regions() 49 memblock.reserved.cnt = 0; in reset_memblock_regions() 50 memblock.reserved.max = INIT_MEMBLOCK_RESERVED_REGIONS; in reset_memblock_regions() [all …]
|
H A D | alloc_exact_nid_api.c | 30 struct memblock_region *new_rgn = &memblock.reserved.regions[0]; in alloc_exact_nid_top_down_numa_simple_check() 31 struct memblock_region *req_node = &memblock.memory.regions[nid_req]; in alloc_exact_nid_top_down_numa_simple_check() 56 ASSERT_EQ(memblock.reserved.cnt, 1); in alloc_exact_nid_top_down_numa_simple_check() 57 ASSERT_EQ(memblock.reserved.total_size, size); in alloc_exact_nid_top_down_numa_simple_check() 82 struct memblock_region *new_rgn = &memblock.reserved.regions[1]; in alloc_exact_nid_top_down_numa_part_reserved_check() 83 struct memblock_region *req_node = &memblock.memory.regions[nid_req]; in alloc_exact_nid_top_down_numa_part_reserved_check() 112 ASSERT_EQ(memblock.reserved.cnt, 2); in alloc_exact_nid_top_down_numa_part_reserved_check() 113 ASSERT_EQ(memblock.reserved.total_size, size + r1.size); in alloc_exact_nid_top_down_numa_part_reserved_check() 143 struct memblock_region *new_rgn = &memblock.reserved.regions[0]; in alloc_exact_nid_top_down_numa_split_range_low_check() 144 struct memblock_region *req_node = &memblock.memory.regions[nid_req]; in alloc_exact_nid_top_down_numa_split_range_low_check() [all …]
|
H A D | common.h | 9 #include <linux/memblock.h> 112 * Available memory registered with memblock needs to be valid for allocs 114 * dummy_physical_memory_init() that is later registered with memblock
|
/linux/tools/testing/memblock/ |
H A D | Makefile | 3 # Memblock simulator requires AddressSanitizer (libasan) and liburcu development 11 DEP_OFILES = memblock.o lib/slab.o mmzone.o slab.o cmdline.o 13 EXTR_SRC = ../../../mm/memblock.c 27 include: ../../../include/linux/memblock.h ../../include/linux/*.h \ 31 test -L linux/memblock.h || ln -s ../../../../include/linux/memblock.h linux/memblock.h 35 memblock.c: $(EXTR_SRC) 36 test -L memblock.c || ln -s $(EXTR_SRC) memblock.c 39 $(RM) $(TARGETS) $(OFILES) linux/memblock.h memblock.c asm/asm.h asm/cmpxchg.h 42 @echo 'Memblock simulator' 45 @echo ' main - Build the memblock simulator'
|
H A D | README | 2 Memblock simulator 8 Memblock is a boot time memory allocator[1] that manages memory regions before 14 difficult. This test suite, usually referred as memblock simulator, is 15 an attempt at testing the memblock mechanism. It runs one monolithic test that 17 allocation functionalities of memblock. The main data structure of the boot time 22 As this project uses the actual memblock code and has to run in user space, 24 introduced memblock simulator (commit 16802e55dea9 ("memblock tests: Add 25 skeleton of the memblock simulator")) and a few preparation commits just 61 memblock 72 | |-- common.(c|h) -- helper functions for resetting memblock; [all …]
|
H A D | .gitignore | 2 memblock.c 3 linux/memblock.h
|
/linux/include/linux/ |
H A D | memblock.h | 47 * either explictitly with memblock_reserve_kern() or via memblock 48 * allocation APIs. All memblock allocations set this flag. 99 * struct memblock - memblock allocator metadata 105 struct memblock { struct 112 extern struct memblock memblock; argument 202 * __for_each_mem_range - iterate through memblock areas from type_a and not 222 * __for_each_mem_range_rev - reverse iterate through memblock areas from 249 __for_each_mem_range(i, &memblock.memory, NULL, NUMA_NO_NODE, \ 254 * for_each_mem_range_rev - reverse iterate through memblock areas from 261 __for_each_mem_range_rev(i, &memblock.memory, NULL, NUMA_NO_NODE, \ [all …]
|
/linux/mm/ |
H A D | memblock.c | 18 #include <linux/memblock.h> 43 * DOC: memblock overview 45 * Memblock is a method of managing memory regions during the early 49 * Memblock views the system memory as collections of contiguous 66 * wrapped with struct memblock. This structure is statically 76 * The early architecture setup should tell memblock what the physical 84 * Once memblock is setup the memory can be allocated using one of the 101 * memblock data structures (except "physmem") will be discarded after the 128 struct memblock memblock __initdata_memblock = { 150 * keep a pointer to &memblock.memory in the text section to use it in [all …]
|
H A D | numa_memblks.c | 6 #include <linux/memblock.h> 246 if (!memblock_overlaps_region(&memblock.memory, in numa_cleanup_meminfo() 330 * Mark all currently memblock-reserved physical memory (which covers the 340 * We have to do some preprocessing of memblock regions, to in numa_clear_kernel_node_hotplug() 343 * At this time, all memory regions reserved by memblock are in numa_clear_kernel_node_hotplug() 349 * set the nid in memblock.reserved. This will split up the in numa_clear_kernel_node_hotplug() 350 * memblock regions along node boundaries and will set the node IDs in numa_clear_kernel_node_hotplug() 358 &memblock.reserved, mb->nid); in numa_clear_kernel_node_hotplug() 363 * Now go over all reserved memblock regions, to construct a in numa_clear_kernel_node_hotplug() 367 * numa_meminfo might not include all memblock.reserved in numa_clear_kernel_node_hotplug() [all …]
|
/linux/Documentation/core-api/ |
H A D | boot-time-mm.rst | 10 A specialized allocator called ``memblock`` performs the 21 Memblock also offers a variety of APIs that control its own behaviour. 23 Memblock Overview 26 .. kernel-doc:: mm/memblock.c 27 :doc: memblock overview 33 Here is the description of memblock data structures, functions and 39 .. kernel-doc:: include/linux/memblock.h 40 .. kernel-doc:: mm/memblock.c
|
/linux/Documentation/translations/zh_CN/core-api/ |
H A D | boot-time-mm.rst | 22 一个叫做 ``memblock`` 的专用分配器执行启动时的内存管理。特定架构的初始化 36 mm/memblock.c 48 include/linux/memblock.h 49 mm/memblock.c
|
/linux/Documentation/core-api/kho/bindings/memblock/ |
H A D | memblock.yaml | 4 title: Memblock reserved memory 10 Memblock can serialize its current memory reservations created with 32 memblock { 33 compatible = "memblock-v1";
|
H A D | reserve-mem.yaml | 4 title: Memblock reserved memory regions 10 Memblock can serialize its current memory reservations created with
|
/linux/Documentation/core-api/kho/ |
H A D | fdt.rst | 55 memblock { 60 where the ``memblock`` node contains an FDT that is requested by the 61 subsystem memblock for preservation. The FDT contains the following 67 compatible = "memblock-v1";
|
/linux/arch/microblaze/mm/ |
H A D | init.c | 11 #include <linux/memblock.h> 133 memblock.memory.regions[0].size = memory_size; in mm_cmdline_setup() 171 if ((u32) memblock.memory.regions[0].size < 0x400000) { in mmu_init() 176 if ((u32) memblock.memory.regions[0].size < kernel_tlb) { in mmu_init() 182 memory_start = (u32) memblock.memory.regions[0].base; in mmu_init() 183 lowmem_size = memory_size = (u32) memblock.memory.regions[0].size; in mmu_init()
|
/linux/arch/loongarch/kernel/ |
H A D | mem.c | 7 #include <linux/memblock.h> 61 memblock_set_node(0, PHYS_ADDR_MAX, &memblock.memory, 0); in memblock_init() 62 memblock_set_node(0, PHYS_ADDR_MAX, &memblock.reserved, 0); in memblock_init()
|
/linux/arch/arm/mm/ |
H A D | pmsa-v8.c | 7 #include <linux/memblock.h> 114 * memblock auto merges contiguous blocks, remove in pmsav8_adjust_lowmem_bounds() 248 add_range(mem, ARRAY_SIZE(mem), 0, memblock.memory.regions[0].base, in pmsav8_setup() 249 memblock.memory.regions[0].base + memblock.memory.regions[0].size); in pmsav8_setup()
|
/linux/arch/mips/include/asm/ |
H A D | dmi.h | 6 #include <linux/memblock.h> 13 /* MIPS initialize DMI scan before SLAB is ready, so we use memblock here */
|
/linux/arch/arm/mach-realtek/ |
H A D | rtd1195.c | 8 #include <linux/memblock.h> 17 pr_err("Failed to remove memblock %pa (%d)\n", &base, ret); in rtd1195_memblock_remove()
|
/linux/mm/kmsan/ |
H A D | init.c | 14 #include <linux/memblock.h> 73 * Allocations via memblock can be only done before slab is initialized. 104 * Eager metadata allocation. When the memblock allocator is freeing pages to 200 * Memblock is about to go away. Split the page blocks left over in held_back[]
|
/linux/drivers/firmware/efi/ |
H A D | efi-init.c | 16 #include <linux/memblock.h> 213 * means it is set aside initially. Don't add a memblock in reserve_regions() 263 * For memblock manipulation, the cap should come after the memblock_add(). in efi_init() 264 * And now, memblock is fully populated, it is time to do capping. in efi_init()
|