| @@ -18,18 +18,29 @@ static const unsigned int node_fractions[] = { · 17 unmodified lines |
| 18 | 18 | 625, /* 1/16 */ |
| 19 | 19 | }; |
| 20 | 20 | |
| 21 | | −static inline const char * const get_memblock_alloc_try_nid_name(int flags) |
| 21 | +static inline const char * const get_memblock_alloc_nid_name(int flags) |
| 22 | 22 | { |
| 23 | + if (flags & TEST_F_EXACT) |
| 24 | + return "memblock_alloc_exact_nid_raw"; |
| 23 | 25 | if (flags & TEST_F_RAW) |
| 24 | 26 | return "memblock_alloc_try_nid_raw"; |
| 25 | 27 | return "memblock_alloc_try_nid"; |
| 26 | 28 | } |
| 27 | 29 | |
| 28 | | −static inline void *run_memblock_alloc_try_nid(phys_addr_t size, |
| 29 | | − phys_addr_t align, |
| 30 | | − phys_addr_t min_addr, |
| 31 | | − phys_addr_t max_addr, int nid) |
| 32 | | −{ |
| 30 | +static inline void *run_memblock_alloc_nid(phys_addr_t size, |
| 31 | + phys_addr_t align, |
| 32 | + phys_addr_t min_addr, |
| 33 | + phys_addr_t max_addr, int nid) |
| 34 | +{ |
| 35 | + assert(!(alloc_nid_test_flags & TEST_F_EXACT) || |
| 36 | + (alloc_nid_test_flags & TEST_F_RAW)); |
| 37 | + /* |
| 38 | + * TEST_F_EXACT should be checked before TEST_F_RAW since |
| 39 | + * memblock_alloc_exact_nid_raw() performs raw allocations. |
| 40 | + */ |
| 41 | + if (alloc_nid_test_flags & TEST_F_EXACT) |
| 42 | + return memblock_alloc_exact_nid_raw(size, align, min_addr, |
| 43 | + max_addr, nid); |
| 33 | 44 | if (alloc_nid_test_flags & TEST_F_RAW) |
| 34 | 45 | return memblock_alloc_try_nid_raw(size, align, min_addr, |
| 35 | 46 | max_addr, nid); |
| @@ -50,7 +61,7 @@ static inline void *run_memblock_alloc_try_nid(phys_addr_t size, · 14 unmodified lines |
| 50 | 61 | * |
| 51 | 62 | * Expect to allocate a region that ends at max_addr. |
| 52 | 63 | */ |
| 53 | | −static int alloc_try_nid_top_down_simple_check(void) |
| 64 | +static int alloc_nid_top_down_simple_check(void) |
| 54 | 65 | { |
| 55 | 66 | struct memblock_region *rgn = &memblock.reserved.regions[0]; |
| 56 | 67 | void *allocated_ptr = NULL; |
| @@ -65,9 +76,9 @@ static int alloc_try_nid_top_down_simple_check(void) · 8 unmodified lines |
| 65 | 76 | min_addr = memblock_start_of_DRAM() + SMP_CACHE_BYTES * 2; |
| 66 | 77 | max_addr = min_addr + SZ_512; |
| 67 | 78 | |
| 68 | | − allocated_ptr = run_memblock_alloc_try_nid(size, SMP_CACHE_BYTES, |
| 69 | | − min_addr, max_addr, |
| 70 | | − NUMA_NO_NODE); |
| 79 | + allocated_ptr = run_memblock_alloc_nid(size, SMP_CACHE_BYTES, |
| 80 | + min_addr, max_addr, |
| 81 | + NUMA_NO_NODE); |
| 71 | 82 | rgn_end = rgn->base + rgn->size; |
| 72 | 83 | |
| 73 | 84 | ASSERT_NE(allocated_ptr, NULL); |
| @@ -102,7 +113,7 @@ static int alloc_try_nid_top_down_simple_check(void) · 28 unmodified lines |
| 102 | 113 | * |
| 103 | 114 | * Expect to allocate an aligned region that ends before max_addr. |
| 104 | 115 | */ |
| 105 | | −static int alloc_try_nid_top_down_end_misaligned_check(void) |
| 116 | +static int alloc_nid_top_down_end_misaligned_check(void) |
| 106 | 117 | { |
| 107 | 118 | struct memblock_region *rgn = &memblock.reserved.regions[0]; |
| 108 | 119 | void *allocated_ptr = NULL; |
| @@ -118,9 +129,9 @@ static int alloc_try_nid_top_down_end_misaligned_check(void) · 9 unmodified lines |
| 118 | 129 | min_addr = memblock_start_of_DRAM() + SMP_CACHE_BYTES * 2; |
| 119 | 130 | max_addr = min_addr + SZ_512 + misalign; |
| 120 | 131 | |
| 121 | | − allocated_ptr = run_memblock_alloc_try_nid(size, SMP_CACHE_BYTES, |
| 122 | | − min_addr, max_addr, |
| 123 | | − NUMA_NO_NODE); |
| 132 | + allocated_ptr = run_memblock_alloc_nid(size, SMP_CACHE_BYTES, |
| 133 | + min_addr, max_addr, |
| 134 | + NUMA_NO_NODE); |
| 124 | 135 | rgn_end = rgn->base + rgn->size; |
| 125 | 136 | |
| 126 | 137 | ASSERT_NE(allocated_ptr, NULL); |
| @@ -153,7 +164,7 @@ static int alloc_try_nid_top_down_end_misaligned_check(void) · 26 unmodified lines |
| 153 | 164 | * Expect to allocate a region that starts at min_addr and ends at |
| 154 | 165 | * max_addr, given that min_addr is aligned. |
| 155 | 166 | */ |
| 156 | | −static int alloc_try_nid_exact_address_generic_check(void) |
| 167 | +static int alloc_nid_exact_address_generic_check(void) |
| 157 | 168 | { |
| 158 | 169 | struct memblock_region *rgn = &memblock.reserved.regions[0]; |
| 159 | 170 | void *allocated_ptr = NULL; |
| @@ -168,9 +179,9 @@ static int alloc_try_nid_exact_address_generic_check(void) · 8 unmodified lines |
| 168 | 179 | min_addr = memblock_start_of_DRAM() + SMP_CACHE_BYTES; |
| 169 | 180 | max_addr = min_addr + size; |
| 170 | 181 | |
| 171 | | − allocated_ptr = run_memblock_alloc_try_nid(size, SMP_CACHE_BYTES, |
| 172 | | − min_addr, max_addr, |
| 173 | | − NUMA_NO_NODE); |
| 182 | + allocated_ptr = run_memblock_alloc_nid(size, SMP_CACHE_BYTES, |
| 183 | + min_addr, max_addr, |
| 184 | + NUMA_NO_NODE); |
| 174 | 185 | rgn_end = rgn->base + rgn->size; |
| 175 | 186 | |
| 176 | 187 | ASSERT_NE(allocated_ptr, NULL); |
| @@ -205,7 +216,7 @@ static int alloc_try_nid_exact_address_generic_check(void) · 28 unmodified lines |
| 205 | 216 | * Expect to drop the lower limit and allocate a memory region which |
| 206 | 217 | * ends at max_addr (if the address is aligned). |
| 207 | 218 | */ |
| 208 | | −static int alloc_try_nid_top_down_narrow_range_check(void) |
| 219 | +static int alloc_nid_top_down_narrow_range_check(void) |
| 209 | 220 | { |
| 210 | 221 | struct memblock_region *rgn = &memblock.reserved.regions[0]; |
| 211 | 222 | void *allocated_ptr = NULL; |
| @@ -219,9 +230,9 @@ static int alloc_try_nid_top_down_narrow_range_check(void) · 7 unmodified lines |
| 219 | 230 | min_addr = memblock_start_of_DRAM() + SZ_512; |
| 220 | 231 | max_addr = min_addr + SMP_CACHE_BYTES; |
| 221 | 232 | |
| 222 | | − allocated_ptr = run_memblock_alloc_try_nid(size, SMP_CACHE_BYTES, |
| 223 | | − min_addr, max_addr, |
| 224 | | − NUMA_NO_NODE); |
| 233 | + allocated_ptr = run_memblock_alloc_nid(size, SMP_CACHE_BYTES, |
| 234 | + min_addr, max_addr, |
| 235 | + NUMA_NO_NODE); |
| 225 | 236 | |
| 226 | 237 | ASSERT_NE(allocated_ptr, NULL); |
| 227 | 238 | assert_mem_content(allocated_ptr, size, alloc_nid_test_flags); |
| @@ -257,7 +268,7 @@ static int alloc_try_nid_top_down_narrow_range_check(void) · 29 unmodified lines |
| 257 | 268 | * |
| 258 | 269 | * Expect no allocation to happen. |
| 259 | 270 | */ |
| 260 | | −static int alloc_try_nid_low_max_generic_check(void) |
| 271 | +static int alloc_nid_low_max_generic_check(void) |
| 261 | 272 | { |
| 262 | 273 | void *allocated_ptr = NULL; |
| 263 | 274 | phys_addr_t size = SZ_1K; |
| @@ -270,9 +281,9 @@ static int alloc_try_nid_low_max_generic_check(void) · 6 unmodified lines |
| 270 | 281 | min_addr = memblock_start_of_DRAM(); |
| 271 | 282 | max_addr = min_addr + SMP_CACHE_BYTES; |
| 272 | 283 | |
| 273 | | − allocated_ptr = run_memblock_alloc_try_nid(size, SMP_CACHE_BYTES, |
| 274 | | − min_addr, max_addr, |
| 275 | | − NUMA_NO_NODE); |
| 284 | + allocated_ptr = run_memblock_alloc_nid(size, SMP_CACHE_BYTES, |
| 285 | + min_addr, max_addr, |
| 286 | + NUMA_NO_NODE); |
| 276 | 287 | |
| 277 | 288 | ASSERT_EQ(allocated_ptr, NULL); |
| 278 | 289 | |
| @@ -295,7 +306,7 @@ static int alloc_try_nid_low_max_generic_check(void) · 16 unmodified lines |
| 295 | 306 | * |
| 296 | 307 | * Expect a merge of both regions. Only the region size gets updated. |
| 297 | 308 | */ |
| 298 | | −static int alloc_try_nid_min_reserved_generic_check(void) |
| 309 | +static int alloc_nid_min_reserved_generic_check(void) |
| 299 | 310 | { |
| 300 | 311 | struct memblock_region *rgn = &memblock.reserved.regions[0]; |
| 301 | 312 | void *allocated_ptr = NULL; |
| @@ -315,9 +326,9 @@ static int alloc_try_nid_min_reserved_generic_check(void) · 13 unmodified lines |
| 315 | 326 | |
| 316 | 327 | memblock_reserve(reserved_base, r1_size); |
| 317 | 328 | |
| 318 | | − allocated_ptr = run_memblock_alloc_try_nid(r2_size, SMP_CACHE_BYTES, |
| 319 | | − min_addr, max_addr, |
| 320 | | − NUMA_NO_NODE); |
| 329 | + allocated_ptr = run_memblock_alloc_nid(r2_size, SMP_CACHE_BYTES, |
| 330 | + min_addr, max_addr, |
| 331 | + NUMA_NO_NODE); |
| 321 | 332 | |
| 322 | 333 | ASSERT_NE(allocated_ptr, NULL); |
| 323 | 334 | assert_mem_content(allocated_ptr, r2_size, alloc_nid_test_flags); |
| @@ -347,7 +358,7 @@ static int alloc_try_nid_min_reserved_generic_check(void) · 23 unmodified lines |
| 347 | 358 | * |
| 348 | 359 | * Expect a merge of regions. Only the region size gets updated. |
| 349 | 360 | */ |
| 350 | | −static int alloc_try_nid_max_reserved_generic_check(void) |
| 361 | +static int alloc_nid_max_reserved_generic_check(void) |
| 351 | 362 | { |
| 352 | 363 | struct memblock_region *rgn = &memblock.reserved.regions[0]; |
| 353 | 364 | void *allocated_ptr = NULL; |
| @@ -365,9 +376,9 @@ static int alloc_try_nid_max_reserved_generic_check(void) · 11 unmodified lines |
| 365 | 376 | |
| 366 | 377 | memblock_reserve(max_addr, r1_size); |
| 367 | 378 | |
| 368 | | − allocated_ptr = run_memblock_alloc_try_nid(r2_size, SMP_CACHE_BYTES, |
| 369 | | − min_addr, max_addr, |
| 370 | | − NUMA_NO_NODE); |
| 379 | + allocated_ptr = run_memblock_alloc_nid(r2_size, SMP_CACHE_BYTES, |
| 380 | + min_addr, max_addr, |
| 381 | + NUMA_NO_NODE); |
| 371 | 382 | |
| 372 | 383 | ASSERT_NE(allocated_ptr, NULL); |
| 373 | 384 | assert_mem_content(allocated_ptr, r2_size, alloc_nid_test_flags); |
| @@ -400,7 +411,7 @@ static int alloc_try_nid_max_reserved_generic_check(void) · 26 unmodified lines |
| 400 | 411 | * updated. The total size field gets updated. |
| 401 | 412 | */ |
| 402 | 413 | |
| 403 | | −static int alloc_try_nid_top_down_reserved_with_space_check(void) |
| 414 | +static int alloc_nid_top_down_reserved_with_space_check(void) |
| 404 | 415 | { |
| 405 | 416 | struct memblock_region *rgn1 = &memblock.reserved.regions[1]; |
| 406 | 417 | struct memblock_region *rgn2 = &memblock.reserved.regions[0]; |
| @@ -428,9 +439,9 @@ static int alloc_try_nid_top_down_reserved_with_space_check(void) · 21 unmodified lines |
| 428 | 439 | memblock_reserve(r1.base, r1.size); |
| 429 | 440 | memblock_reserve(r2.base, r2.size); |
| 430 | 441 | |
| 431 | | − allocated_ptr = run_memblock_alloc_try_nid(r3_size, SMP_CACHE_BYTES, |
| 432 | | − min_addr, max_addr, |
| 433 | | − NUMA_NO_NODE); |
| 442 | + allocated_ptr = run_memblock_alloc_nid(r3_size, SMP_CACHE_BYTES, |
| 443 | + min_addr, max_addr, |
| 444 | + NUMA_NO_NODE); |
| 434 | 445 | |
| 435 | 446 | ASSERT_NE(allocated_ptr, NULL); |
| 436 | 447 | assert_mem_content(allocated_ptr, r3_size, alloc_nid_test_flags); |
| @@ -465,7 +476,7 @@ static int alloc_try_nid_top_down_reserved_with_space_check(void) · 28 unmodified lines |
| 465 | 476 | * Expect to merge all of the regions into one. The region counter and total |
| 466 | 477 | * size fields get updated. |
| 467 | 478 | */ |
| 468 | | −static int alloc_try_nid_reserved_full_merge_generic_check(void) |
| 479 | +static int alloc_nid_reserved_full_merge_generic_check(void) |
| 469 | 480 | { |
| 470 | 481 | struct memblock_region *rgn = &memblock.reserved.regions[0]; |
| 471 | 482 | void *allocated_ptr = NULL; |
| @@ -491,9 +502,9 @@ static int alloc_try_nid_reserved_full_merge_generic_check(void) · 19 unmodified lines |
| 491 | 502 | memblock_reserve(r1.base, r1.size); |
| 492 | 503 | memblock_reserve(r2.base, r2.size); |
| 493 | 504 | |
| 494 | | − allocated_ptr = run_memblock_alloc_try_nid(r3_size, SMP_CACHE_BYTES, |
| 495 | | − min_addr, max_addr, |
| 496 | | − NUMA_NO_NODE); |
| 505 | + allocated_ptr = run_memblock_alloc_nid(r3_size, SMP_CACHE_BYTES, |
| 506 | + min_addr, max_addr, |
| 507 | + NUMA_NO_NODE); |
| 497 | 508 | |
| 498 | 509 | ASSERT_NE(allocated_ptr, NULL); |
| 499 | 510 | assert_mem_content(allocated_ptr, r3_size, alloc_nid_test_flags); |
| @@ -527,7 +538,7 @@ static int alloc_try_nid_reserved_full_merge_generic_check(void) · 27 unmodified lines |
| 527 | 538 | * Expect to merge the new region with r2. The second region does not get |
| 528 | 539 | * updated. The total size counter gets updated. |
| 529 | 540 | */ |
| 530 | | −static int alloc_try_nid_top_down_reserved_no_space_check(void) |
| 541 | +static int alloc_nid_top_down_reserved_no_space_check(void) |
| 531 | 542 | { |
| 532 | 543 | struct memblock_region *rgn1 = &memblock.reserved.regions[1]; |
| 533 | 544 | struct memblock_region *rgn2 = &memblock.reserved.regions[0]; |
| @@ -555,9 +566,9 @@ static int alloc_try_nid_top_down_reserved_no_space_check(void) · 21 unmodified lines |
| 555 | 566 | memblock_reserve(r1.base, r1.size); |
| 556 | 567 | memblock_reserve(r2.base, r2.size); |
| 557 | 568 | |
| 558 | | − allocated_ptr = run_memblock_alloc_try_nid(r3_size, SMP_CACHE_BYTES, |
| 559 | | − min_addr, max_addr, |
| 560 | | − NUMA_NO_NODE); |
| 569 | + allocated_ptr = run_memblock_alloc_nid(r3_size, SMP_CACHE_BYTES, |
| 570 | + min_addr, max_addr, |
| 571 | + NUMA_NO_NODE); |
| 561 | 572 | |
| 562 | 573 | ASSERT_NE(allocated_ptr, NULL); |
| 563 | 574 | assert_mem_content(allocated_ptr, r3_size, alloc_nid_test_flags); |
| @@ -596,7 +607,7 @@ static int alloc_try_nid_top_down_reserved_no_space_check(void) · 32 unmodified lines |
| 596 | 607 | * Expect no allocation to happen. |
| 597 | 608 | */ |
| 598 | 609 | |
| 599 | | −static int alloc_try_nid_reserved_all_generic_check(void) |
| 610 | +static int alloc_nid_reserved_all_generic_check(void) |
| 600 | 611 | { |
| 601 | 612 | void *allocated_ptr = NULL; |
| 602 | 613 | struct region r1, r2; |
| @@ -620,9 +631,9 @@ static int alloc_try_nid_reserved_all_generic_check(void) · 17 unmodified lines |
| 620 | 631 | memblock_reserve(r1.base, r1.size); |
| 621 | 632 | memblock_reserve(r2.base, r2.size); |
| 622 | 633 | |
| 623 | | − allocated_ptr = run_memblock_alloc_try_nid(r3_size, SMP_CACHE_BYTES, |
| 624 | | − min_addr, max_addr, |
| 625 | | − NUMA_NO_NODE); |
| 634 | + allocated_ptr = run_memblock_alloc_nid(r3_size, SMP_CACHE_BYTES, |
| 635 | + min_addr, max_addr, |
| 636 | + NUMA_NO_NODE); |
| 626 | 637 | |
| 627 | 638 | ASSERT_EQ(allocated_ptr, NULL); |
| 628 | 639 | |
| @@ -636,7 +647,7 @@ static int alloc_try_nid_reserved_all_generic_check(void) · 7 unmodified lines |
| 636 | 647 | * bigger than the end address of the available memory. Expect to allocate |
| 637 | 648 | * a region that ends before the end of the memory. |
| 638 | 649 | */ |
| 639 | | −static int alloc_try_nid_top_down_cap_max_check(void) |
| 650 | +static int alloc_nid_top_down_cap_max_check(void) |
| 640 | 651 | { |
| 641 | 652 | struct memblock_region *rgn = &memblock.reserved.regions[0]; |
| 642 | 653 | void *allocated_ptr = NULL; |
| @@ -650,9 +661,9 @@ static int alloc_try_nid_top_down_cap_max_check(void) · 7 unmodified lines |
| 650 | 661 | min_addr = memblock_end_of_DRAM() - SZ_1K; |
| 651 | 662 | max_addr = memblock_end_of_DRAM() + SZ_256; |
| 652 | 663 | |
| 653 | | − allocated_ptr = run_memblock_alloc_try_nid(size, SMP_CACHE_BYTES, |
| 654 | | − min_addr, max_addr, |
| 655 | | − NUMA_NO_NODE); |
| 664 | + allocated_ptr = run_memblock_alloc_nid(size, SMP_CACHE_BYTES, |
| 665 | + min_addr, max_addr, |
| 666 | + NUMA_NO_NODE); |
| 656 | 667 | |
| 657 | 668 | ASSERT_NE(allocated_ptr, NULL); |
| 658 | 669 | assert_mem_content(allocated_ptr, size, alloc_nid_test_flags); |
| @@ -673,7 +684,7 @@ static int alloc_try_nid_top_down_cap_max_check(void) · 14 unmodified lines |
| 673 | 684 | * smaller than the start address of the available memory. Expect to allocate |
| 674 | 685 | * a region that ends before the end of the memory. |
| 675 | 686 | */ |
| 676 | | −static int alloc_try_nid_top_down_cap_min_check(void) |
| 687 | +static int alloc_nid_top_down_cap_min_check(void) |
| 677 | 688 | { |
| 678 | 689 | struct memblock_region *rgn = &memblock.reserved.regions[0]; |
| 679 | 690 | void *allocated_ptr = NULL; |
| @@ -687,9 +698,9 @@ static int alloc_try_nid_top_down_cap_min_check(void) · 7 unmodified lines |
| 687 | 698 | min_addr = memblock_start_of_DRAM() - SZ_256; |
| 688 | 699 | max_addr = memblock_end_of_DRAM(); |
| 689 | 700 | |
| 690 | | − allocated_ptr = run_memblock_alloc_try_nid(size, SMP_CACHE_BYTES, |
| 691 | | − min_addr, max_addr, |
| 692 | | − NUMA_NO_NODE); |
| 701 | + allocated_ptr = run_memblock_alloc_nid(size, SMP_CACHE_BYTES, |
| 702 | + min_addr, max_addr, |
| 703 | + NUMA_NO_NODE); |
| 693 | 704 | |
| 694 | 705 | ASSERT_NE(allocated_ptr, NULL); |
| 695 | 706 | assert_mem_content(allocated_ptr, size, alloc_nid_test_flags); |
| @@ -719,7 +730,7 @@ static int alloc_try_nid_top_down_cap_min_check(void) · 23 unmodified lines |
| 719 | 730 | * |
| 720 | 731 | * Expect to allocate a region that ends before max_addr. |
| 721 | 732 | */ |
| 722 | | −static int alloc_try_nid_bottom_up_simple_check(void) |
| 733 | +static int alloc_nid_bottom_up_simple_check(void) |
| 723 | 734 | { |
| 724 | 735 | struct memblock_region *rgn = &memblock.reserved.regions[0]; |
| 725 | 736 | void *allocated_ptr = NULL; |
| @@ -734,9 +745,9 @@ static int alloc_try_nid_bottom_up_simple_check(void) · 8 unmodified lines |
| 734 | 745 | min_addr = memblock_start_of_DRAM() + SMP_CACHE_BYTES * 2; |
| 735 | 746 | max_addr = min_addr + SZ_512; |
| 736 | 747 | |
| 737 | | − allocated_ptr = run_memblock_alloc_try_nid(size, SMP_CACHE_BYTES, |
| 738 | | − min_addr, max_addr, |
| 739 | | − NUMA_NO_NODE); |
| 748 | + allocated_ptr = run_memblock_alloc_nid(size, SMP_CACHE_BYTES, |
| 749 | + min_addr, max_addr, |
| 750 | + NUMA_NO_NODE); |
| 740 | 751 | rgn_end = rgn->base + rgn->size; |
| 741 | 752 | |
| 742 | 753 | ASSERT_NE(allocated_ptr, NULL); |
| @@ -771,7 +782,7 @@ static int alloc_try_nid_bottom_up_simple_check(void) · 28 unmodified lines |
| 771 | 782 | * |
| 772 | 783 | * Expect to allocate an aligned region that ends before max_addr. |
| 773 | 784 | */ |
| 774 | | −static int alloc_try_nid_bottom_up_start_misaligned_check(void) |
| 785 | +static int alloc_nid_bottom_up_start_misaligned_check(void) |
| 775 | 786 | { |
| 776 | 787 | struct memblock_region *rgn = &memblock.reserved.regions[0]; |
| 777 | 788 | void *allocated_ptr = NULL; |
| @@ -787,9 +798,9 @@ static int alloc_try_nid_bottom_up_start_misaligned_check(void) · 9 unmodified lines |
| 787 | 798 | min_addr = memblock_start_of_DRAM() + misalign; |
| 788 | 799 | max_addr = min_addr + SZ_512; |
| 789 | 800 | |
| 790 | | − allocated_ptr = run_memblock_alloc_try_nid(size, SMP_CACHE_BYTES, |
| 791 | | − min_addr, max_addr, |
| 792 | | − NUMA_NO_NODE); |
| 801 | + allocated_ptr = run_memblock_alloc_nid(size, SMP_CACHE_BYTES, |
| 802 | + min_addr, max_addr, |
| 803 | + NUMA_NO_NODE); |
| 793 | 804 | rgn_end = rgn->base + rgn->size; |
| 794 | 805 | |
| 795 | 806 | ASSERT_NE(allocated_ptr, NULL); |
| @@ -824,7 +835,7 @@ static int alloc_try_nid_bottom_up_start_misaligned_check(void) · 28 unmodified lines |
| 824 | 835 | * Expect to drop the lower limit and allocate a memory region which |
| 825 | 836 | * starts at the beginning of the available memory. |
| 826 | 837 | */ |
| 827 | | −static int alloc_try_nid_bottom_up_narrow_range_check(void) |
| 838 | +static int alloc_nid_bottom_up_narrow_range_check(void) |
| 828 | 839 | { |
| 829 | 840 | struct memblock_region *rgn = &memblock.reserved.regions[0]; |
| 830 | 841 | void *allocated_ptr = NULL; |
| @@ -838,9 +849,9 @@ static int alloc_try_nid_bottom_up_narrow_range_check(void) · 7 unmodified lines |
| 838 | 849 | min_addr = memblock_start_of_DRAM() + SZ_512; |
| 839 | 850 | max_addr = min_addr + SMP_CACHE_BYTES; |
| 840 | 851 | |
| 841 | | − allocated_ptr = run_memblock_alloc_try_nid(size, SMP_CACHE_BYTES, |
| 842 | | − min_addr, max_addr, |
| 843 | | − NUMA_NO_NODE); |
| 852 | + allocated_ptr = run_memblock_alloc_nid(size, SMP_CACHE_BYTES, |
| 853 | + min_addr, max_addr, |
| 854 | + NUMA_NO_NODE); |
| 844 | 855 | |
| 845 | 856 | ASSERT_NE(allocated_ptr, NULL); |
| 846 | 857 | assert_mem_content(allocated_ptr, size, alloc_nid_test_flags); |
| @@ -873,7 +884,7 @@ static int alloc_try_nid_bottom_up_narrow_range_check(void) · 26 unmodified lines |
| 873 | 884 | * updated. The total size field gets updated. |
| 874 | 885 | */ |
| 875 | 886 | |
| 876 | | −static int alloc_try_nid_bottom_up_reserved_with_space_check(void) |
| 887 | +static int alloc_nid_bottom_up_reserved_with_space_check(void) |
| 877 | 888 | { |
| 878 | 889 | struct memblock_region *rgn1 = &memblock.reserved.regions[1]; |
| 879 | 890 | struct memblock_region *rgn2 = &memblock.reserved.regions[0]; |
| @@ -901,9 +912,9 @@ static int alloc_try_nid_bottom_up_reserved_with_space_check(void) · 21 unmodified lines |
| 901 | 912 | memblock_reserve(r1.base, r1.size); |
| 902 | 913 | memblock_reserve(r2.base, r2.size); |
| 903 | 914 | |
| 904 | | − allocated_ptr = run_memblock_alloc_try_nid(r3_size, SMP_CACHE_BYTES, |
| 905 | | − min_addr, max_addr, |
| 906 | | − NUMA_NO_NODE); |
| 915 | + allocated_ptr = run_memblock_alloc_nid(r3_size, SMP_CACHE_BYTES, |
| 916 | + min_addr, max_addr, |
| 917 | + NUMA_NO_NODE); |
| 907 | 918 | |
| 908 | 919 | ASSERT_NE(allocated_ptr, NULL); |
| 909 | 920 | assert_mem_content(allocated_ptr, r3_size, alloc_nid_test_flags); |
| @@ -942,7 +953,7 @@ static int alloc_try_nid_bottom_up_reserved_with_space_check(void) · 32 unmodified lines |
| 942 | 953 | * Other regions are not modified. |
| 943 | 954 | */ |
| 944 | 955 | |
| 945 | | −static int alloc_try_nid_bottom_up_reserved_no_space_check(void) |
| 956 | +static int alloc_nid_bottom_up_reserved_no_space_check(void) |
| 946 | 957 | { |
| 947 | 958 | struct memblock_region *rgn1 = &memblock.reserved.regions[2]; |
| 948 | 959 | struct memblock_region *rgn2 = &memblock.reserved.regions[1]; |
| @@ -971,9 +982,9 @@ static int alloc_try_nid_bottom_up_reserved_no_space_check(void) · 22 unmodified lines |
| 971 | 982 | memblock_reserve(r1.base, r1.size); |
| 972 | 983 | memblock_reserve(r2.base, r2.size); |
| 973 | 984 | |
| 974 | | − allocated_ptr = run_memblock_alloc_try_nid(r3_size, SMP_CACHE_BYTES, |
| 975 | | − min_addr, max_addr, |
| 976 | | − NUMA_NO_NODE); |
| 985 | + allocated_ptr = run_memblock_alloc_nid(r3_size, SMP_CACHE_BYTES, |
| 986 | + min_addr, max_addr, |
| 987 | + NUMA_NO_NODE); |
| 977 | 988 | |
| 978 | 989 | ASSERT_NE(allocated_ptr, NULL); |
| 979 | 990 | assert_mem_content(allocated_ptr, r3_size, alloc_nid_test_flags); |
| @@ -1000,7 +1011,7 @@ static int alloc_try_nid_bottom_up_reserved_no_space_check(void) · 20 unmodified lines |
| 1000 | 1011 | * bigger than the end address of the available memory. Expect to allocate |
| 1001 | 1012 | * a region that starts at the min_addr. |
| 1002 | 1013 | */ |
| 1003 | | −static int alloc_try_nid_bottom_up_cap_max_check(void) |
| 1014 | +static int alloc_nid_bottom_up_cap_max_check(void) |
| 1004 | 1015 | { |
| 1005 | 1016 | struct memblock_region *rgn = &memblock.reserved.regions[0]; |
| 1006 | 1017 | void *allocated_ptr = NULL; |
| @@ -1014,9 +1025,9 @@ static int alloc_try_nid_bottom_up_cap_max_check(void) · 7 unmodified lines |
| 1014 | 1025 | min_addr = memblock_start_of_DRAM() + SZ_1K; |
| 1015 | 1026 | max_addr = memblock_end_of_DRAM() + SZ_256; |
| 1016 | 1027 | |
| 1017 | | − allocated_ptr = run_memblock_alloc_try_nid(size, SMP_CACHE_BYTES, |
| 1018 | | − min_addr, max_addr, |
| 1019 | | − NUMA_NO_NODE); |
| 1028 | + allocated_ptr = run_memblock_alloc_nid(size, SMP_CACHE_BYTES, |
| 1029 | + min_addr, max_addr, |
| 1030 | + NUMA_NO_NODE); |
| 1020 | 1031 | |
| 1021 | 1032 | ASSERT_NE(allocated_ptr, NULL); |
| 1022 | 1033 | assert_mem_content(allocated_ptr, size, alloc_nid_test_flags); |
| @@ -1037,7 +1048,7 @@ static int alloc_try_nid_bottom_up_cap_max_check(void) · 14 unmodified lines |
| 1037 | 1048 | * smaller than the start address of the available memory. Expect to allocate |
| 1038 | 1049 | * a region at the beginning of the available memory. |
| 1039 | 1050 | */ |
| 1040 | | −static int alloc_try_nid_bottom_up_cap_min_check(void) |
| 1051 | +static int alloc_nid_bottom_up_cap_min_check(void) |
| 1041 | 1052 | { |
| 1042 | 1053 | struct memblock_region *rgn = &memblock.reserved.regions[0]; |
| 1043 | 1054 | void *allocated_ptr = NULL; |
| @@ -1051,9 +1062,9 @@ static int alloc_try_nid_bottom_up_cap_min_check(void) · 7 unmodified lines |
| 1051 | 1062 | min_addr = memblock_start_of_DRAM(); |
| 1052 | 1063 | max_addr = memblock_end_of_DRAM() - SZ_256; |
| 1053 | 1064 | |
| 1054 | | − allocated_ptr = run_memblock_alloc_try_nid(size, SMP_CACHE_BYTES, |
| 1055 | | − min_addr, max_addr, |
| 1056 | | − NUMA_NO_NODE); |
| 1065 | + allocated_ptr = run_memblock_alloc_nid(size, SMP_CACHE_BYTES, |
| 1066 | + min_addr, max_addr, |
| 1067 | + NUMA_NO_NODE); |
| 1057 | 1068 | |
| 1058 | 1069 | ASSERT_NE(allocated_ptr, NULL); |
| 1059 | 1070 | assert_mem_content(allocated_ptr, size, alloc_nid_test_flags); |
| @@ -1070,133 +1081,133 @@ static int alloc_try_nid_bottom_up_cap_min_check(void) · 10 unmodified lines |
| 1070 | 1081 | } |
| 1071 | 1082 | |
| 1072 | 1083 | /* Test case wrappers for range tests */ |
| 1073 | | −static int alloc_try_nid_simple_check(void) |
| 1084 | +static int alloc_nid_simple_check(void) |
| 1074 | 1085 | { |
| 1075 | 1086 | test_print("\tRunning %s...\n", __func__); |
| 1076 | 1087 | memblock_set_bottom_up(false); |
| 1077 | | − alloc_try_nid_top_down_simple_check(); |
| 1088 | + alloc_nid_top_down_simple_check(); |
| 1078 | 1089 | memblock_set_bottom_up(true); |
| 1079 | | − alloc_try_nid_bottom_up_simple_check(); |
| 1090 | + alloc_nid_bottom_up_simple_check(); |
| 1080 | 1091 | |
| 1081 | 1092 | return 0; |
| 1082 | 1093 | } |
| 1083 | 1094 | |
| 1084 | | −static int alloc_try_nid_misaligned_check(void) |
| 1095 | +static int alloc_nid_misaligned_check(void) |
| 1085 | 1096 | { |
| 1086 | 1097 | test_print("\tRunning %s...\n", __func__); |
| 1087 | 1098 | memblock_set_bottom_up(false); |
| 1088 | | − alloc_try_nid_top_down_end_misaligned_check(); |
| 1099 | + alloc_nid_top_down_end_misaligned_check(); |
| 1089 | 1100 | memblock_set_bottom_up(true); |
| 1090 | | − alloc_try_nid_bottom_up_start_misaligned_check(); |
| 1101 | + alloc_nid_bottom_up_start_misaligned_check(); |
| 1091 | 1102 | |
| 1092 | 1103 | return 0; |
| 1093 | 1104 | } |
| 1094 | 1105 | |
| 1095 | | −static int alloc_try_nid_narrow_range_check(void) |
| 1106 | +static int alloc_nid_narrow_range_check(void) |
| 1096 | 1107 | { |
| 1097 | 1108 | test_print("\tRunning %s...\n", __func__); |
| 1098 | 1109 | memblock_set_bottom_up(false); |
| 1099 | | − alloc_try_nid_top_down_narrow_range_check(); |
| 1110 | + alloc_nid_top_down_narrow_range_check(); |
| 1100 | 1111 | memblock_set_bottom_up(true); |
| 1101 | | − alloc_try_nid_bottom_up_narrow_range_check(); |
| 1112 | + alloc_nid_bottom_up_narrow_range_check(); |
| 1102 | 1113 | |
| 1103 | 1114 | return 0; |
| 1104 | 1115 | } |
| 1105 | 1116 | |
| 1106 | | −static int alloc_try_nid_reserved_with_space_check(void) |
| 1117 | +static int alloc_nid_reserved_with_space_check(void) |
| 1107 | 1118 | { |
| 1108 | 1119 | test_print("\tRunning %s...\n", __func__); |
| 1109 | 1120 | memblock_set_bottom_up(false); |
| 1110 | | − alloc_try_nid_top_down_reserved_with_space_check(); |
| 1121 | + alloc_nid_top_down_reserved_with_space_check(); |
| 1111 | 1122 | memblock_set_bottom_up(true); |
| 1112 | | − alloc_try_nid_bottom_up_reserved_with_space_check(); |
| 1123 | + alloc_nid_bottom_up_reserved_with_space_check(); |
| 1113 | 1124 | |
| 1114 | 1125 | return 0; |
| 1115 | 1126 | } |
| 1116 | 1127 | |
| 1117 | | −static int alloc_try_nid_reserved_no_space_check(void) |
| 1128 | +static int alloc_nid_reserved_no_space_check(void) |
| 1118 | 1129 | { |
| 1119 | 1130 | test_print("\tRunning %s...\n", __func__); |
| 1120 | 1131 | memblock_set_bottom_up(false); |
| 1121 | | − alloc_try_nid_top_down_reserved_no_space_check(); |
| 1132 | + alloc_nid_top_down_reserved_no_space_check(); |
| 1122 | 1133 | memblock_set_bottom_up(true); |
| 1123 | | − alloc_try_nid_bottom_up_reserved_no_space_check(); |
| 1134 | + alloc_nid_bottom_up_reserved_no_space_check(); |
| 1124 | 1135 | |
| 1125 | 1136 | return 0; |
| 1126 | 1137 | } |
| 1127 | 1138 | |
| 1128 | | −static int alloc_try_nid_cap_max_check(void) |
| 1139 | +static int alloc_nid_cap_max_check(void) |
| 1129 | 1140 | { |
| 1130 | 1141 | test_print("\tRunning %s...\n", __func__); |
| 1131 | 1142 | memblock_set_bottom_up(false); |
| 1132 | | − alloc_try_nid_top_down_cap_max_check(); |
| 1143 | + alloc_nid_top_down_cap_max_check(); |
| 1133 | 1144 | memblock_set_bottom_up(true); |
| 1134 | | − alloc_try_nid_bottom_up_cap_max_check(); |
| 1145 | + alloc_nid_bottom_up_cap_max_check(); |
| 1135 | 1146 | |
| 1136 | 1147 | return 0; |
| 1137 | 1148 | } |
| 1138 | 1149 | |
| 1139 | | −static int alloc_try_nid_cap_min_check(void) |
| 1150 | +static int alloc_nid_cap_min_check(void) |
| 1140 | 1151 | { |
| 1141 | 1152 | test_print("\tRunning %s...\n", __func__); |
| 1142 | 1153 | memblock_set_bottom_up(false); |
| 1143 | | − alloc_try_nid_top_down_cap_min_check(); |
| 1154 | + alloc_nid_top_down_cap_min_check(); |
| 1144 | 1155 | memblock_set_bottom_up(true); |
| 1145 | | − alloc_try_nid_bottom_up_cap_min_check(); |
| 1156 | + alloc_nid_bottom_up_cap_min_check(); |
| 1146 | 1157 | |
| 1147 | 1158 | return 0; |
| 1148 | 1159 | } |
| 1149 | 1160 | |
| 1150 | | −static int alloc_try_nid_min_reserved_check(void) |
| 1161 | +static int alloc_nid_min_reserved_check(void) |
| 1151 | 1162 | { |
| 1152 | 1163 | test_print("\tRunning %s...\n", __func__); |
| 1153 | | − run_top_down(alloc_try_nid_min_reserved_generic_check); |
| 1154 | | − run_bottom_up(alloc_try_nid_min_reserved_generic_check); |
| 1164 | + run_top_down(alloc_nid_min_reserved_generic_check); |
| 1165 | + run_bottom_up(alloc_nid_min_reserved_generic_check); |
| 1155 | 1166 | |
| 1156 | 1167 | return 0; |
| 1157 | 1168 | } |
| 1158 | 1169 | |
| 1159 | | −static int alloc_try_nid_max_reserved_check(void) |
| 1170 | +static int alloc_nid_max_reserved_check(void) |
| 1160 | 1171 | { |
| 1161 | 1172 | test_print("\tRunning %s...\n", __func__); |
| 1162 | | − run_top_down(alloc_try_nid_max_reserved_generic_check); |
| 1163 | | − run_bottom_up(alloc_try_nid_max_reserved_generic_check); |
| 1173 | + run_top_down(alloc_nid_max_reserved_generic_check); |
| 1174 | + run_bottom_up(alloc_nid_max_reserved_generic_check); |
| 1164 | 1175 | |
| 1165 | 1176 | return 0; |
| 1166 | 1177 | } |
| 1167 | 1178 | |
| 1168 | | −static int alloc_try_nid_exact_address_check(void) |
| 1179 | +static int alloc_nid_exact_address_check(void) |
| 1169 | 1180 | { |
| 1170 | 1181 | test_print("\tRunning %s...\n", __func__); |
| 1171 | | − run_top_down(alloc_try_nid_exact_address_generic_check); |
| 1172 | | − run_bottom_up(alloc_try_nid_exact_address_generic_check); |
| 1182 | + run_top_down(alloc_nid_exact_address_generic_check); |
| 1183 | + run_bottom_up(alloc_nid_exact_address_generic_check); |
| 1173 | 1184 | |
| 1174 | 1185 | return 0; |
| 1175 | 1186 | } |
| 1176 | 1187 | |
| 1177 | | −static int alloc_try_nid_reserved_full_merge_check(void) |
| 1188 | +static int alloc_nid_reserved_full_merge_check(void) |
| 1178 | 1189 | { |
| 1179 | 1190 | test_print("\tRunning %s...\n", __func__); |
| 1180 | | − run_top_down(alloc_try_nid_reserved_full_merge_generic_check); |
| 1181 | | − run_bottom_up(alloc_try_nid_reserved_full_merge_generic_check); |
| 1191 | + run_top_down(alloc_nid_reserved_full_merge_generic_check); |
| 1192 | + run_bottom_up(alloc_nid_reserved_full_merge_generic_check); |
| 1182 | 1193 | |
| 1183 | 1194 | return 0; |
| 1184 | 1195 | } |
| 1185 | 1196 | |
| 1186 | | −static int alloc_try_nid_reserved_all_check(void) |
| 1197 | +static int alloc_nid_reserved_all_check(void) |
| 1187 | 1198 | { |
| 1188 | 1199 | test_print("\tRunning %s...\n", __func__); |
| 1189 | | − run_top_down(alloc_try_nid_reserved_all_generic_check); |
| 1190 | | − run_bottom_up(alloc_try_nid_reserved_all_generic_check); |
| 1200 | + run_top_down(alloc_nid_reserved_all_generic_check); |
| 1201 | + run_bottom_up(alloc_nid_reserved_all_generic_check); |
| 1191 | 1202 | |
| 1192 | 1203 | return 0; |
| 1193 | 1204 | } |
| 1194 | 1205 | |
| 1195 | | −static int alloc_try_nid_low_max_check(void) |
| 1206 | +static int alloc_nid_low_max_check(void) |
| 1196 | 1207 | { |
| 1197 | 1208 | test_print("\tRunning %s...\n", __func__); |
| 1198 | | − run_top_down(alloc_try_nid_low_max_generic_check); |
| 1199 | | − run_bottom_up(alloc_try_nid_low_max_generic_check); |
| 1209 | + run_top_down(alloc_nid_low_max_generic_check); |
| 1210 | + run_bottom_up(alloc_nid_low_max_generic_check); |
| 1200 | 1211 | |
| 1201 | 1212 | return 0; |
| 1202 | 1213 | } |
| @@ -1204,22 +1215,22 @@ static int alloc_try_nid_low_max_check(void) · 1 unmodified line |
| 1204 | 1215 | static int memblock_alloc_nid_range_checks(void) |
| 1205 | 1216 | { |
| 1206 | 1217 | test_print("Running %s range tests...\n", |
| 1207 | | − get_memblock_alloc_try_nid_name(alloc_nid_test_flags)); |
| 1218 | + get_memblock_alloc_nid_name(alloc_nid_test_flags)); |
| 1208 | 1219 | |
| 1209 | | − alloc_try_nid_simple_check(); |
| 1210 | | − alloc_try_nid_misaligned_check(); |
| 1211 | | − alloc_try_nid_narrow_range_check(); |
| 1212 | | − alloc_try_nid_reserved_with_space_check(); |
| 1213 | | − alloc_try_nid_reserved_no_space_check(); |
| 1214 | | − alloc_try_nid_cap_max_check(); |
| 1215 | | − alloc_try_nid_cap_min_check(); |
| 1220 | + alloc_nid_simple_check(); |
| 1221 | + alloc_nid_misaligned_check(); |
| 1222 | + alloc_nid_narrow_range_check(); |
| 1223 | + alloc_nid_reserved_with_space_check(); |
| 1224 | + alloc_nid_reserved_no_space_check(); |
| 1225 | + alloc_nid_cap_max_check(); |
| 1226 | + alloc_nid_cap_min_check(); |
| 1216 | 1227 | |
| 1217 | | − alloc_try_nid_min_reserved_check(); |
| 1218 | | − alloc_try_nid_max_reserved_check(); |
| 1219 | | − alloc_try_nid_exact_address_check(); |
| 1220 | | − alloc_try_nid_reserved_full_merge_check(); |
| 1221 | | − alloc_try_nid_reserved_all_check(); |
| 1222 | | − alloc_try_nid_low_max_check(); |
| 1228 | + alloc_nid_min_reserved_check(); |
| 1229 | + alloc_nid_max_reserved_check(); |
| 1230 | + alloc_nid_exact_address_check(); |
| 1231 | + alloc_nid_reserved_full_merge_check(); |
| 1232 | + alloc_nid_reserved_all_check(); |
| 1233 | + alloc_nid_low_max_check(); |
| 1223 | 1234 | |
| 1224 | 1235 | return 0; |
| 1225 | 1236 | } |
| @@ -1229,7 +1240,7 @@ static int memblock_alloc_nid_range_checks(void) · 3 unmodified lines |
| 1229 | 1240 | * has enough memory to allocate a region of the requested size. |
| 1230 | 1241 | * Expect to allocate an aligned region at the end of the requested node. |
| 1231 | 1242 | */ |
| 1232 | | −static int alloc_try_nid_top_down_numa_simple_check(void) |
| 1243 | +static int alloc_nid_top_down_numa_simple_check(void) |
| 1233 | 1244 | { |
| 1234 | 1245 | int nid_req = 3; |
| 1235 | 1246 | struct memblock_region *new_rgn = &memblock.reserved.regions[0]; |
| @@ -1247,8 +1258,8 @@ static int alloc_try_nid_top_down_numa_simple_check(void) · 11 unmodified lines |
| 1247 | 1258 | min_addr = memblock_start_of_DRAM(); |
| 1248 | 1259 | max_addr = memblock_end_of_DRAM(); |
| 1249 | 1260 | |
| 1250 | | − allocated_ptr = run_memblock_alloc_try_nid(size, SMP_CACHE_BYTES, |
| 1251 | | − min_addr, max_addr, nid_req); |
| 1261 | + allocated_ptr = run_memblock_alloc_nid(size, SMP_CACHE_BYTES, |
| 1262 | + min_addr, max_addr, nid_req); |
| 1252 | 1263 | |
| 1253 | 1264 | ASSERT_NE(allocated_ptr, NULL); |
| 1254 | 1265 | assert_mem_content(allocated_ptr, size, alloc_nid_test_flags); |
| @@ -1280,7 +1291,7 @@ static int alloc_try_nid_top_down_numa_simple_check(void) · 25 unmodified lines |
| 1280 | 1291 | * Expect to allocate an aligned region at the end of the last node that has |
| 1281 | 1292 | * enough memory (in this case, nid = 6) after falling back to NUMA_NO_NODE. |
| 1282 | 1293 | */ |
| 1283 | | −static int alloc_try_nid_top_down_numa_small_node_check(void) |
| 1294 | +static int alloc_nid_top_down_numa_small_node_check(void) |
| 1284 | 1295 | { |
| 1285 | 1296 | int nid_req = 1; |
| 1286 | 1297 | int nid_exp = 6; |
| @@ -1299,8 +1310,8 @@ static int alloc_try_nid_top_down_numa_small_node_check(void) · 12 unmodified lines |
| 1299 | 1310 | min_addr = memblock_start_of_DRAM(); |
| 1300 | 1311 | max_addr = memblock_end_of_DRAM(); |
| 1301 | 1312 | |
| 1302 | | − allocated_ptr = run_memblock_alloc_try_nid(size, SMP_CACHE_BYTES, |
| 1303 | | − min_addr, max_addr, nid_req); |
| 1313 | + allocated_ptr = run_memblock_alloc_nid(size, SMP_CACHE_BYTES, |
| 1314 | + min_addr, max_addr, nid_req); |
| 1304 | 1315 | |
| 1305 | 1316 | ASSERT_NE(allocated_ptr, NULL); |
| 1306 | 1317 | assert_mem_content(allocated_ptr, size, alloc_nid_test_flags); |
| @@ -1333,7 +1344,7 @@ static int alloc_try_nid_top_down_numa_small_node_check(void) · 26 unmodified lines |
| 1333 | 1344 | * large enough and has enough unreserved memory (in this case, nid = 6) after |
| 1334 | 1345 | * falling back to NUMA_NO_NODE. The region count and total size get updated. |
| 1335 | 1346 | */ |
| 1336 | | −static int alloc_try_nid_top_down_numa_node_reserved_check(void) |
| 1347 | +static int alloc_nid_top_down_numa_node_reserved_check(void) |
| 1337 | 1348 | { |
| 1338 | 1349 | int nid_req = 2; |
| 1339 | 1350 | int nid_exp = 6; |
| @@ -1353,8 +1364,8 @@ static int alloc_try_nid_top_down_numa_node_reserved_check(void) · 13 unmodified lines |
| 1353 | 1364 | max_addr = memblock_end_of_DRAM(); |
| 1354 | 1365 | |
| 1355 | 1366 | memblock_reserve(req_node->base, req_node->size); |
| 1356 | | − allocated_ptr = run_memblock_alloc_try_nid(size, SMP_CACHE_BYTES, |
| 1357 | | − min_addr, max_addr, nid_req); |
| 1367 | + allocated_ptr = run_memblock_alloc_nid(size, SMP_CACHE_BYTES, |
| 1368 | + min_addr, max_addr, nid_req); |
| 1358 | 1369 | |
| 1359 | 1370 | ASSERT_NE(allocated_ptr, NULL); |
| 1360 | 1371 | assert_mem_content(allocated_ptr, size, alloc_nid_test_flags); |
| @@ -1386,7 +1397,7 @@ static int alloc_try_nid_top_down_numa_node_reserved_check(void) · 25 unmodified lines |
| 1386 | 1397 | * Expect to allocate an aligned region at the end of the requested node. The |
| 1387 | 1398 | * region count and total size get updated. |
| 1388 | 1399 | */ |
| 1389 | | −static int alloc_try_nid_top_down_numa_part_reserved_check(void) |
| 1400 | +static int alloc_nid_top_down_numa_part_reserved_check(void) |
| 1390 | 1401 | { |
| 1391 | 1402 | int nid_req = 4; |
| 1392 | 1403 | struct memblock_region *new_rgn = &memblock.reserved.regions[1]; |
| @@ -1408,8 +1419,8 @@ static int alloc_try_nid_top_down_numa_part_reserved_check(void) · 15 unmodified lines |
| 1408 | 1419 | max_addr = memblock_end_of_DRAM(); |
| 1409 | 1420 | |
| 1410 | 1421 | memblock_reserve(r1.base, r1.size); |
| 1411 | | − allocated_ptr = run_memblock_alloc_try_nid(size, SMP_CACHE_BYTES, |
| 1412 | | − min_addr, max_addr, nid_req); |
| 1422 | + allocated_ptr = run_memblock_alloc_nid(size, SMP_CACHE_BYTES, |
| 1423 | + min_addr, max_addr, nid_req); |
| 1413 | 1424 | |
| 1414 | 1425 | ASSERT_NE(allocated_ptr, NULL); |
| 1415 | 1426 | assert_mem_content(allocated_ptr, size, alloc_nid_test_flags); |
| @@ -1444,7 +1455,7 @@ static int alloc_try_nid_top_down_numa_part_reserved_check(void) · 28 unmodified lines |
| 1444 | 1455 | * nid = NUMA_NODES - 1) after falling back to NUMA_NO_NODE. The region count |
| 1445 | 1456 | * and total size get updated. |
| 1446 | 1457 | */ |
| 1447 | | −static int alloc_try_nid_top_down_numa_part_reserved_fallback_check(void) |
| 1458 | +static int alloc_nid_top_down_numa_part_reserved_fallback_check(void) |
| 1448 | 1459 | { |
| 1449 | 1460 | int nid_req = 4; |
| 1450 | 1461 | int nid_exp = NUMA_NODES - 1; |
| @@ -1469,8 +1480,8 @@ static int alloc_try_nid_top_down_numa_part_reserved_fallback_check(void) · 18 unmodified lines |
| 1469 | 1480 | max_addr = memblock_end_of_DRAM(); |
| 1470 | 1481 | |
| 1471 | 1482 | memblock_reserve(r1.base, r1.size); |
| 1472 | | − allocated_ptr = run_memblock_alloc_try_nid(size, SMP_CACHE_BYTES, |
| 1473 | | − min_addr, max_addr, nid_req); |
| 1483 | + allocated_ptr = run_memblock_alloc_nid(size, SMP_CACHE_BYTES, |
| 1484 | + min_addr, max_addr, nid_req); |
| 1474 | 1485 | |
| 1475 | 1486 | ASSERT_NE(allocated_ptr, NULL); |
| 1476 | 1487 | assert_mem_content(allocated_ptr, size, alloc_nid_test_flags); |
| @@ -1507,7 +1518,7 @@ static int alloc_try_nid_top_down_numa_part_reserved_fallback_check(void) · 30 unmodified lines |
| 1507 | 1518 | * Expect to drop the lower limit and allocate a memory region that ends at |
| 1508 | 1519 | * the end of the requested node. |
| 1509 | 1520 | */ |
| 1510 | | −static int alloc_try_nid_top_down_numa_split_range_low_check(void) |
| 1521 | +static int alloc_nid_top_down_numa_split_range_low_check(void) |
| 1511 | 1522 | { |
| 1512 | 1523 | int nid_req = 2; |
| 1513 | 1524 | struct memblock_region *new_rgn = &memblock.reserved.regions[0]; |
| @@ -1525,8 +1536,8 @@ static int alloc_try_nid_top_down_numa_split_range_low_check(void) · 11 unmodified lines |
| 1525 | 1536 | min_addr = req_node_end - SZ_256; |
| 1526 | 1537 | max_addr = min_addr + size; |
| 1527 | 1538 | |
| 1528 | | − allocated_ptr = run_memblock_alloc_try_nid(size, SMP_CACHE_BYTES, |
| 1529 | | − min_addr, max_addr, nid_req); |
| 1539 | + allocated_ptr = run_memblock_alloc_nid(size, SMP_CACHE_BYTES, |
| 1540 | + min_addr, max_addr, nid_req); |
| 1530 | 1541 | |
| 1531 | 1542 | ASSERT_NE(allocated_ptr, NULL); |
| 1532 | 1543 | assert_mem_content(allocated_ptr, size, alloc_nid_test_flags); |
| @@ -1563,7 +1574,7 @@ static int alloc_try_nid_top_down_numa_split_range_low_check(void) · 30 unmodified lines |
| 1563 | 1574 | * Expect to drop the lower limit and allocate a memory region that |
| 1564 | 1575 | * ends at the end of the first node that overlaps with the range. |
| 1565 | 1576 | */ |
| 1566 | | −static int alloc_try_nid_top_down_numa_split_range_high_check(void) |
| 1577 | +static int alloc_nid_top_down_numa_split_range_high_check(void) |
| 1567 | 1578 | { |
| 1568 | 1579 | int nid_req = 3; |
| 1569 | 1580 | int nid_exp = nid_req - 1; |
| @@ -1582,8 +1593,8 @@ static int alloc_try_nid_top_down_numa_split_range_high_check(void) · 12 unmodified lines |
| 1582 | 1593 | min_addr = exp_node_end - SZ_256; |
| 1583 | 1594 | max_addr = min_addr + size; |
| 1584 | 1595 | |
| 1585 | | − allocated_ptr = run_memblock_alloc_try_nid(size, SMP_CACHE_BYTES, |
| 1586 | | − min_addr, max_addr, nid_req); |
| 1596 | + allocated_ptr = run_memblock_alloc_nid(size, SMP_CACHE_BYTES, |
| 1597 | + min_addr, max_addr, nid_req); |
| 1587 | 1598 | |
| 1588 | 1599 | ASSERT_NE(allocated_ptr, NULL); |
| 1589 | 1600 | assert_mem_content(allocated_ptr, size, alloc_nid_test_flags); |
| @@ -1620,7 +1631,7 @@ static int alloc_try_nid_top_down_numa_split_range_high_check(void) · 30 unmodified lines |
| 1620 | 1631 | * Expect to drop the lower limit and allocate a memory region that ends at |
| 1621 | 1632 | * the end of the requested node. |
| 1622 | 1633 | */ |
| 1623 | | −static int alloc_try_nid_top_down_numa_no_overlap_split_check(void) |
| 1634 | +static int alloc_nid_top_down_numa_no_overlap_split_check(void) |
| 1624 | 1635 | { |
| 1625 | 1636 | int nid_req = 2; |
| 1626 | 1637 | struct memblock_region *new_rgn = &memblock.reserved.regions[0]; |
| @@ -1638,8 +1649,8 @@ static int alloc_try_nid_top_down_numa_no_overlap_split_check(void) · 11 unmodified lines |
| 1638 | 1649 | min_addr = node2->base - SZ_256; |
| 1639 | 1650 | max_addr = min_addr + size; |
| 1640 | 1651 | |
| 1641 | | − allocated_ptr = run_memblock_alloc_try_nid(size, SMP_CACHE_BYTES, |
| 1642 | | − min_addr, max_addr, nid_req); |
| 1652 | + allocated_ptr = run_memblock_alloc_nid(size, SMP_CACHE_BYTES, |
| 1653 | + min_addr, max_addr, nid_req); |
| 1643 | 1654 | |
| 1644 | 1655 | ASSERT_NE(allocated_ptr, NULL); |
| 1645 | 1656 | assert_mem_content(allocated_ptr, size, alloc_nid_test_flags); |
| @@ -1677,7 +1688,7 @@ static int alloc_try_nid_top_down_numa_no_overlap_split_check(void) · 31 unmodified lines |
| 1677 | 1688 | * Expect to allocate a memory region at the end of the final node in |
| 1678 | 1689 | * the range after falling back to NUMA_NO_NODE. |
| 1679 | 1690 | */ |
| 1680 | | −static int alloc_try_nid_top_down_numa_no_overlap_low_check(void) |
| 1691 | +static int alloc_nid_top_down_numa_no_overlap_low_check(void) |
| 1681 | 1692 | { |
| 1682 | 1693 | int nid_req = 0; |
| 1683 | 1694 | struct memblock_region *new_rgn = &memblock.reserved.regions[0]; |
| @@ -1694,8 +1705,8 @@ static int alloc_try_nid_top_down_numa_no_overlap_low_check(void) · 10 unmodified lines |
| 1694 | 1705 | min_addr = min_node->base; |
| 1695 | 1706 | max_addr = region_end(max_node); |
| 1696 | 1707 | |
| 1697 | | − allocated_ptr = run_memblock_alloc_try_nid(size, SMP_CACHE_BYTES, |
| 1698 | | − min_addr, max_addr, nid_req); |
| 1708 | + allocated_ptr = run_memblock_alloc_nid(size, SMP_CACHE_BYTES, |
| 1709 | + min_addr, max_addr, nid_req); |
| 1699 | 1710 | |
| 1700 | 1711 | ASSERT_NE(allocated_ptr, NULL); |
| 1701 | 1712 | assert_mem_content(allocated_ptr, size, alloc_nid_test_flags); |
| @@ -1733,7 +1744,7 @@ static int alloc_try_nid_top_down_numa_no_overlap_low_check(void) · 31 unmodified lines |
| 1733 | 1744 | * Expect to allocate a memory region at the end of the final node in |
| 1734 | 1745 | * the range after falling back to NUMA_NO_NODE. |
| 1735 | 1746 | */ |
| 1736 | | −static int alloc_try_nid_top_down_numa_no_overlap_high_check(void) |
| 1747 | +static int alloc_nid_top_down_numa_no_overlap_high_check(void) |
| 1737 | 1748 | { |
| 1738 | 1749 | int nid_req = 7; |
| 1739 | 1750 | struct memblock_region *new_rgn = &memblock.reserved.regions[0]; |
| @@ -1750,8 +1761,8 @@ static int alloc_try_nid_top_down_numa_no_overlap_high_check(void) · 10 unmodified lines |
| 1750 | 1761 | min_addr = min_node->base; |
| 1751 | 1762 | max_addr = region_end(max_node); |
| 1752 | 1763 | |
| 1753 | | − allocated_ptr = run_memblock_alloc_try_nid(size, SMP_CACHE_BYTES, |
| 1754 | | − min_addr, max_addr, nid_req); |
| 1764 | + allocated_ptr = run_memblock_alloc_nid(size, SMP_CACHE_BYTES, |
| 1765 | + min_addr, max_addr, nid_req); |
| 1755 | 1766 | |
| 1756 | 1767 | ASSERT_NE(allocated_ptr, NULL); |
| 1757 | 1768 | assert_mem_content(allocated_ptr, size, alloc_nid_test_flags); |
| @@ -1773,7 +1784,7 @@ static int alloc_try_nid_top_down_numa_no_overlap_high_check(void) · 15 unmodified lines |
| 1773 | 1784 | * has enough memory to allocate a region of the requested size. |
| 1774 | 1785 | * Expect to allocate an aligned region at the beginning of the requested node. |
| 1775 | 1786 | */ |
| 1776 | | −static int alloc_try_nid_bottom_up_numa_simple_check(void) |
| 1787 | +static int alloc_nid_bottom_up_numa_simple_check(void) |
| 1777 | 1788 | { |
| 1778 | 1789 | int nid_req = 3; |
| 1779 | 1790 | struct memblock_region *new_rgn = &memblock.reserved.regions[0]; |
| @@ -1791,8 +1802,8 @@ static int alloc_try_nid_bottom_up_numa_simple_check(void) · 11 unmodified lines |
| 1791 | 1802 | min_addr = memblock_start_of_DRAM(); |
| 1792 | 1803 | max_addr = memblock_end_of_DRAM(); |
| 1793 | 1804 | |
| 1794 | | − allocated_ptr = run_memblock_alloc_try_nid(size, SMP_CACHE_BYTES, |
| 1795 | | − min_addr, max_addr, nid_req); |
| 1805 | + allocated_ptr = run_memblock_alloc_nid(size, SMP_CACHE_BYTES, |
| 1806 | + min_addr, max_addr, nid_req); |
| 1796 | 1807 | |
| 1797 | 1808 | ASSERT_NE(allocated_ptr, NULL); |
| 1798 | 1809 | assert_mem_content(allocated_ptr, size, alloc_nid_test_flags); |
| @@ -1824,7 +1835,7 @@ static int alloc_try_nid_bottom_up_numa_simple_check(void) · 25 unmodified lines |
| 1824 | 1835 | * Expect to allocate an aligned region at the beginning of the first node that |
| 1825 | 1836 | * has enough memory (in this case, nid = 0) after falling back to NUMA_NO_NODE. |
| 1826 | 1837 | */ |
| 1827 | | −static int alloc_try_nid_bottom_up_numa_small_node_check(void) |
| 1838 | +static int alloc_nid_bottom_up_numa_small_node_check(void) |
| 1828 | 1839 | { |
| 1829 | 1840 | int nid_req = 1; |
| 1830 | 1841 | int nid_exp = 0; |
| @@ -1843,8 +1854,8 @@ static int alloc_try_nid_bottom_up_numa_small_node_check(void) · 12 unmodified lines |
| 1843 | 1854 | min_addr = memblock_start_of_DRAM(); |
| 1844 | 1855 | max_addr = memblock_end_of_DRAM(); |
| 1845 | 1856 | |
| 1846 | | − allocated_ptr = run_memblock_alloc_try_nid(size, SMP_CACHE_BYTES, |
| 1847 | | − min_addr, max_addr, nid_req); |
| 1857 | + allocated_ptr = run_memblock_alloc_nid(size, SMP_CACHE_BYTES, |
| 1858 | + min_addr, max_addr, nid_req); |
| 1848 | 1859 | |
| 1849 | 1860 | ASSERT_NE(allocated_ptr, NULL); |
| 1850 | 1861 | assert_mem_content(allocated_ptr, size, alloc_nid_test_flags); |
| @@ -1878,7 +1889,7 @@ static int alloc_try_nid_bottom_up_numa_small_node_check(void) · 27 unmodified lines |
| 1878 | 1889 | * after falling back to NUMA_NO_NODE. The region count and total size get |
| 1879 | 1890 | * updated. |
| 1880 | 1891 | */ |
| 1881 | | −static int alloc_try_nid_bottom_up_numa_node_reserved_check(void) |
| 1892 | +static int alloc_nid_bottom_up_numa_node_reserved_check(void) |
| 1882 | 1893 | { |
| 1883 | 1894 | int nid_req = 2; |
| 1884 | 1895 | int nid_exp = 0; |
| @@ -1898,8 +1909,8 @@ static int alloc_try_nid_bottom_up_numa_node_reserved_check(void) · 13 unmodified lines |
| 1898 | 1909 | max_addr = memblock_end_of_DRAM(); |
| 1899 | 1910 | |
| 1900 | 1911 | memblock_reserve(req_node->base, req_node->size); |
| 1901 | | − allocated_ptr = run_memblock_alloc_try_nid(size, SMP_CACHE_BYTES, |
| 1902 | | − min_addr, max_addr, nid_req); |
| 1912 | + allocated_ptr = run_memblock_alloc_nid(size, SMP_CACHE_BYTES, |
| 1913 | + min_addr, max_addr, nid_req); |
| 1903 | 1914 | |
| 1904 | 1915 | ASSERT_NE(allocated_ptr, NULL); |
| 1905 | 1916 | assert_mem_content(allocated_ptr, size, alloc_nid_test_flags); |
| @@ -1931,7 +1942,7 @@ static int alloc_try_nid_bottom_up_numa_node_reserved_check(void) · 25 unmodified lines |
| 1931 | 1942 | * Expect to allocate an aligned region in the requested node that merges with |
| 1932 | 1943 | * the existing reserved region. The total size gets updated. |
| 1933 | 1944 | */ |
| 1934 | | −static int alloc_try_nid_bottom_up_numa_part_reserved_check(void) |
| 1945 | +static int alloc_nid_bottom_up_numa_part_reserved_check(void) |
| 1935 | 1946 | { |
| 1936 | 1947 | int nid_req = 4; |
| 1937 | 1948 | struct memblock_region *new_rgn = &memblock.reserved.regions[0]; |
| @@ -1955,8 +1966,8 @@ static int alloc_try_nid_bottom_up_numa_part_reserved_check(void) · 17 unmodified lines |
| 1955 | 1966 | total_size = size + r1.size; |
| 1956 | 1967 | |
| 1957 | 1968 | memblock_reserve(r1.base, r1.size); |
| 1958 | | − allocated_ptr = run_memblock_alloc_try_nid(size, SMP_CACHE_BYTES, |
| 1959 | | − min_addr, max_addr, nid_req); |
| 1969 | + allocated_ptr = run_memblock_alloc_nid(size, SMP_CACHE_BYTES, |
| 1970 | + min_addr, max_addr, nid_req); |
| 1960 | 1971 | |
| 1961 | 1972 | ASSERT_NE(allocated_ptr, NULL); |
| 1962 | 1973 | assert_mem_content(allocated_ptr, size, alloc_nid_test_flags); |
| @@ -1991,7 +2002,7 @@ static int alloc_try_nid_bottom_up_numa_part_reserved_check(void) · 28 unmodified lines |
| 1991 | 2002 | * nid = 0) after falling back to NUMA_NO_NODE. The region count and total size |
| 1992 | 2003 | * get updated. |
| 1993 | 2004 | */ |
| 1994 | | −static int alloc_try_nid_bottom_up_numa_part_reserved_fallback_check(void) |
| 2005 | +static int alloc_nid_bottom_up_numa_part_reserved_fallback_check(void) |
| 1995 | 2006 | { |
| 1996 | 2007 | int nid_req = 4; |
| 1997 | 2008 | int nid_exp = 0; |
| @@ -2016,8 +2027,8 @@ static int alloc_try_nid_bottom_up_numa_part_reserved_fallback_check(void) · 18 unmodified lines |
| 2016 | 2027 | max_addr = memblock_end_of_DRAM(); |
| 2017 | 2028 | |
| 2018 | 2029 | memblock_reserve(r1.base, r1.size); |
| 2019 | | − allocated_ptr = run_memblock_alloc_try_nid(size, SMP_CACHE_BYTES, |
| 2020 | | − min_addr, max_addr, nid_req); |
| 2030 | + allocated_ptr = run_memblock_alloc_nid(size, SMP_CACHE_BYTES, |
| 2031 | + min_addr, max_addr, nid_req); |
| 2021 | 2032 | |
| 2022 | 2033 | ASSERT_NE(allocated_ptr, NULL); |
| 2023 | 2034 | assert_mem_content(allocated_ptr, size, alloc_nid_test_flags); |
| @@ -2054,7 +2065,7 @@ static int alloc_try_nid_bottom_up_numa_part_reserved_fallback_check(void) · 30 unmodified lines |
| 2054 | 2065 | * Expect to drop the lower limit and allocate a memory region at the beginning |
| 2055 | 2066 | * of the requested node. |
| 2056 | 2067 | */ |
| 2057 | | −static int alloc_try_nid_bottom_up_numa_split_range_low_check(void) |
| 2068 | +static int alloc_nid_bottom_up_numa_split_range_low_check(void) |
| 2058 | 2069 | { |
| 2059 | 2070 | int nid_req = 2; |
| 2060 | 2071 | struct memblock_region *new_rgn = &memblock.reserved.regions[0]; |
| @@ -2072,8 +2083,8 @@ static int alloc_try_nid_bottom_up_numa_split_range_low_check(void) · 11 unmodified lines |
| 2072 | 2083 | min_addr = req_node_end - SZ_256; |
| 2073 | 2084 | max_addr = min_addr + size; |
| 2074 | 2085 | |
| 2075 | | − allocated_ptr = run_memblock_alloc_try_nid(size, SMP_CACHE_BYTES, |
| 2076 | | − min_addr, max_addr, nid_req); |
| 2086 | + allocated_ptr = run_memblock_alloc_nid(size, SMP_CACHE_BYTES, |
| 2087 | + min_addr, max_addr, nid_req); |
| 2077 | 2088 | |
| 2078 | 2089 | ASSERT_NE(allocated_ptr, NULL); |
| 2079 | 2090 | assert_mem_content(allocated_ptr, size, alloc_nid_test_flags); |
| @@ -2110,7 +2121,7 @@ static int alloc_try_nid_bottom_up_numa_split_range_low_check(void) · 30 unmodified lines |
| 2110 | 2121 | * Expect to drop the lower limit and allocate a memory region at the beginning |
| 2111 | 2122 | * of the first node that has enough memory. |
| 2112 | 2123 | */ |
| 2113 | | −static int alloc_try_nid_bottom_up_numa_split_range_high_check(void) |
| 2124 | +static int alloc_nid_bottom_up_numa_split_range_high_check(void) |
| 2114 | 2125 | { |
| 2115 | 2126 | int nid_req = 3; |
| 2116 | 2127 | int nid_exp = 0; |
| @@ -2130,8 +2141,8 @@ static int alloc_try_nid_bottom_up_numa_split_range_high_check(void) · 13 unmodified lines |
| 2130 | 2141 | min_addr = req_node->base - SZ_256; |
| 2131 | 2142 | max_addr = min_addr + size; |
| 2132 | 2143 | |
| 2133 | | − allocated_ptr = run_memblock_alloc_try_nid(size, SMP_CACHE_BYTES, |
| 2134 | | − min_addr, max_addr, nid_req); |
| 2144 | + allocated_ptr = run_memblock_alloc_nid(size, SMP_CACHE_BYTES, |
| 2145 | + min_addr, max_addr, nid_req); |
| 2135 | 2146 | |
| 2136 | 2147 | ASSERT_NE(allocated_ptr, NULL); |
| 2137 | 2148 | assert_mem_content(allocated_ptr, size, alloc_nid_test_flags); |
| @@ -2168,7 +2179,7 @@ static int alloc_try_nid_bottom_up_numa_split_range_high_check(void) · 30 unmodified lines |
| 2168 | 2179 | * Expect to drop the lower limit and allocate a memory region that starts at |
| 2169 | 2180 | * the beginning of the requested node. |
| 2170 | 2181 | */ |
| 2171 | | −static int alloc_try_nid_bottom_up_numa_no_overlap_split_check(void) |
| 2182 | +static int alloc_nid_bottom_up_numa_no_overlap_split_check(void) |
| 2172 | 2183 | { |
| 2173 | 2184 | int nid_req = 2; |
| 2174 | 2185 | struct memblock_region *new_rgn = &memblock.reserved.regions[0]; |
| @@ -2186,8 +2197,8 @@ static int alloc_try_nid_bottom_up_numa_no_overlap_split_check(void) · 11 unmodified lines |
| 2186 | 2197 | min_addr = node2->base - SZ_256; |
| 2187 | 2198 | max_addr = min_addr + size; |
| 2188 | 2199 | |
| 2189 | | − allocated_ptr = run_memblock_alloc_try_nid(size, SMP_CACHE_BYTES, |
| 2190 | | − min_addr, max_addr, nid_req); |
| 2200 | + allocated_ptr = run_memblock_alloc_nid(size, SMP_CACHE_BYTES, |
| 2201 | + min_addr, max_addr, nid_req); |
| 2191 | 2202 | |
| 2192 | 2203 | ASSERT_NE(allocated_ptr, NULL); |
| 2193 | 2204 | assert_mem_content(allocated_ptr, size, alloc_nid_test_flags); |
| @@ -2225,7 +2236,7 @@ static int alloc_try_nid_bottom_up_numa_no_overlap_split_check(void) · 31 unmodified lines |
| 2225 | 2236 | * Expect to allocate a memory region at the beginning of the first node |
| 2226 | 2237 | * in the range after falling back to NUMA_NO_NODE. |
| 2227 | 2238 | */ |
| 2228 | | −static int alloc_try_nid_bottom_up_numa_no_overlap_low_check(void) |
| 2239 | +static int alloc_nid_bottom_up_numa_no_overlap_low_check(void) |
| 2229 | 2240 | { |
| 2230 | 2241 | int nid_req = 0; |
| 2231 | 2242 | struct memblock_region *new_rgn = &memblock.reserved.regions[0]; |
| @@ -2242,8 +2253,8 @@ static int alloc_try_nid_bottom_up_numa_no_overlap_low_check(void) · 10 unmodified lines |
| 2242 | 2253 | min_addr = min_node->base; |
| 2243 | 2254 | max_addr = region_end(max_node); |
| 2244 | 2255 | |
| 2245 | | − allocated_ptr = run_memblock_alloc_try_nid(size, SMP_CACHE_BYTES, |
| 2246 | | − min_addr, max_addr, nid_req); |
| 2256 | + allocated_ptr = run_memblock_alloc_nid(size, SMP_CACHE_BYTES, |
| 2257 | + min_addr, max_addr, nid_req); |
| 2247 | 2258 | |
| 2248 | 2259 | ASSERT_NE(allocated_ptr, NULL); |
| 2249 | 2260 | assert_mem_content(allocated_ptr, size, alloc_nid_test_flags); |
| @@ -2281,7 +2292,7 @@ static int alloc_try_nid_bottom_up_numa_no_overlap_low_check(void) · 31 unmodified lines |
| 2281 | 2292 | * Expect to allocate a memory region at the beginning of the first node |
| 2282 | 2293 | * in the range after falling back to NUMA_NO_NODE. |
| 2283 | 2294 | */ |
| 2284 | | −static int alloc_try_nid_bottom_up_numa_no_overlap_high_check(void) |
| 2295 | +static int alloc_nid_bottom_up_numa_no_overlap_high_check(void) |
| 2285 | 2296 | { |
| 2286 | 2297 | int nid_req = 7; |
| 2287 | 2298 | struct memblock_region *new_rgn = &memblock.reserved.regions[0]; |
| @@ -2298,8 +2309,8 @@ static int alloc_try_nid_bottom_up_numa_no_overlap_high_check(void) · 10 unmodified lines |
| 2298 | 2309 | min_addr = min_node->base; |
| 2299 | 2310 | max_addr = region_end(max_node); |
| 2300 | 2311 | |
| 2301 | | − allocated_ptr = run_memblock_alloc_try_nid(size, SMP_CACHE_BYTES, |
| 2302 | | − min_addr, max_addr, nid_req); |
| 2312 | + allocated_ptr = run_memblock_alloc_nid(size, SMP_CACHE_BYTES, |
| 2313 | + min_addr, max_addr, nid_req); |
| 2303 | 2314 | |
| 2304 | 2315 | ASSERT_NE(allocated_ptr, NULL); |
| 2305 | 2316 | assert_mem_content(allocated_ptr, size, alloc_nid_test_flags); |
| @@ -2330,7 +2341,7 @@ static int alloc_try_nid_bottom_up_numa_no_overlap_high_check(void) · 24 unmodified lines |
| 2330 | 2341 | * |
| 2331 | 2342 | * Expect no allocation to happen. |
| 2332 | 2343 | */ |
| 2333 | | −static int alloc_try_nid_numa_large_region_generic_check(void) |
| 2344 | +static int alloc_nid_numa_large_region_generic_check(void) |
| 2334 | 2345 | { |
| 2335 | 2346 | int nid_req = 3; |
| 2336 | 2347 | void *allocated_ptr = NULL; |
| @@ -2344,8 +2355,8 @@ static int alloc_try_nid_numa_large_region_generic_check(void) · 7 unmodified lines |
| 2344 | 2355 | min_addr = memblock_start_of_DRAM(); |
| 2345 | 2356 | max_addr = memblock_end_of_DRAM(); |
| 2346 | 2357 | |
| 2347 | | − allocated_ptr = run_memblock_alloc_try_nid(size, SMP_CACHE_BYTES, |
| 2348 | | − min_addr, max_addr, nid_req); |
| 2358 | + allocated_ptr = run_memblock_alloc_nid(size, SMP_CACHE_BYTES, |
| 2359 | + min_addr, max_addr, nid_req); |
| 2349 | 2360 | ASSERT_EQ(allocated_ptr, NULL); |
| 2350 | 2361 | |
| 2351 | 2362 | test_pass_pop(); |
| @@ -2374,7 +2385,7 @@ static int alloc_try_nid_numa_large_region_generic_check(void) · 22 unmodified lines |
| 2374 | 2385 | * Expect to merge all of the regions into one. The region counter and total |
| 2375 | 2386 | * size fields get updated. |
| 2376 | 2387 | */ |
| 2377 | | −static int alloc_try_nid_numa_reserved_full_merge_generic_check(void) |
| 2388 | +static int alloc_nid_numa_reserved_full_merge_generic_check(void) |
| 2378 | 2389 | { |
| 2379 | 2390 | int nid_req = 6; |
| 2380 | 2391 | int nid_next = nid_req + 1; |
| @@ -2404,8 +2415,8 @@ static int alloc_try_nid_numa_reserved_full_merge_generic_check(void) · 23 unmodified lines |
| 2404 | 2415 | memblock_reserve(r1.base, r1.size); |
| 2405 | 2416 | memblock_reserve(r2.base, r2.size); |
| 2406 | 2417 | |
| 2407 | | − allocated_ptr = run_memblock_alloc_try_nid(size, SMP_CACHE_BYTES, |
| 2408 | | − min_addr, max_addr, nid_req); |
| 2418 | + allocated_ptr = run_memblock_alloc_nid(size, SMP_CACHE_BYTES, |
| 2419 | + min_addr, max_addr, nid_req); |
| 2409 | 2420 | |
| 2410 | 2421 | ASSERT_NE(allocated_ptr, NULL); |
| 2411 | 2422 | assert_mem_content(allocated_ptr, size, alloc_nid_test_flags); |
| @@ -2448,7 +2459,7 @@ static int alloc_try_nid_numa_reserved_full_merge_generic_check(void) · 36 unmodified lines |
| 2448 | 2459 | * |
| 2449 | 2460 | * Expect no allocation to happen. |
| 2450 | 2461 | */ |
| 2451 | | −static int alloc_try_nid_numa_split_all_reserved_generic_check(void) |
| 2462 | +static int alloc_nid_numa_split_all_reserved_generic_check(void) |
| 2452 | 2463 | { |
| 2453 | 2464 | void *allocated_ptr = NULL; |
| 2454 | 2465 | struct memblock_region *next_node = &memblock.memory.regions[7]; |
| @@ -2472,9 +2483,9 @@ static int alloc_try_nid_numa_split_all_reserved_generic_check(void) · 17 unmodified lines |
| 2472 | 2483 | memblock_reserve(r1.base, r1.size); |
| 2473 | 2484 | memblock_reserve(r2.base, r2.size); |
| 2474 | 2485 | |
| 2475 | | − allocated_ptr = run_memblock_alloc_try_nid(size, SMP_CACHE_BYTES, |
| 2476 | | − min_addr, max_addr, |
| 2477 | | − NUMA_NO_NODE); |
| 2486 | + allocated_ptr = run_memblock_alloc_nid(size, SMP_CACHE_BYTES, |
| 2487 | + min_addr, max_addr, |
| 2488 | + NUMA_NO_NODE); |
| 2478 | 2489 | |
| 2479 | 2490 | ASSERT_EQ(allocated_ptr, NULL); |
| 2480 | 2491 | |
| @@ -2484,139 +2495,139 @@ static int alloc_try_nid_numa_split_all_reserved_generic_check(void) · 3 unmodified lines |
| 2484 | 2495 | } |
| 2485 | 2496 | |
| 2486 | 2497 | /* Test case wrappers for NUMA tests */ |
| 2487 | | −static int alloc_try_nid_numa_simple_check(void) |
| 2498 | +static int alloc_nid_numa_simple_check(void) |
| 2488 | 2499 | { |
| 2489 | 2500 | test_print("\tRunning %s...\n", __func__); |
| 2490 | 2501 | memblock_set_bottom_up(false); |
| 2491 | | − alloc_try_nid_top_down_numa_simple_check(); |
| 2502 | + alloc_nid_top_down_numa_simple_check(); |
| 2492 | 2503 | memblock_set_bottom_up(true); |
| 2493 | | − alloc_try_nid_bottom_up_numa_simple_check(); |
| 2504 | + alloc_nid_bottom_up_numa_simple_check(); |
| 2494 | 2505 | |
| 2495 | 2506 | return 0; |
| 2496 | 2507 | } |
| 2497 | 2508 | |
| 2498 | | −static int alloc_try_nid_numa_small_node_check(void) |
| 2509 | +static int alloc_nid_numa_small_node_check(void) |
| 2499 | 2510 | { |
| 2500 | 2511 | test_print("\tRunning %s...\n", __func__); |
| 2501 | 2512 | memblock_set_bottom_up(false); |
| 2502 | | − alloc_try_nid_top_down_numa_small_node_check(); |
| 2513 | + alloc_nid_top_down_numa_small_node_check(); |
| 2503 | 2514 | memblock_set_bottom_up(true); |
| 2504 | | − alloc_try_nid_bottom_up_numa_small_node_check(); |
| 2515 | + alloc_nid_bottom_up_numa_small_node_check(); |
| 2505 | 2516 | |
| 2506 | 2517 | return 0; |
| 2507 | 2518 | } |
| 2508 | 2519 | |
| 2509 | | −static int alloc_try_nid_numa_node_reserved_check(void) |
| 2520 | +static int alloc_nid_numa_node_reserved_check(void) |
| 2510 | 2521 | { |
| 2511 | 2522 | test_print("\tRunning %s...\n", __func__); |
| 2512 | 2523 | memblock_set_bottom_up(false); |
| 2513 | | − alloc_try_nid_top_down_numa_node_reserved_check(); |
| 2524 | + alloc_nid_top_down_numa_node_reserved_check(); |
| 2514 | 2525 | memblock_set_bottom_up(true); |
| 2515 | | − alloc_try_nid_bottom_up_numa_node_reserved_check(); |
| 2526 | + alloc_nid_bottom_up_numa_node_reserved_check(); |
| 2516 | 2527 | |
| 2517 | 2528 | return 0; |
| 2518 | 2529 | } |
| 2519 | 2530 | |
| 2520 | | −static int alloc_try_nid_numa_part_reserved_check(void) |
| 2531 | +static int alloc_nid_numa_part_reserved_check(void) |
| 2521 | 2532 | { |
| 2522 | 2533 | test_print("\tRunning %s...\n", __func__); |
| 2523 | 2534 | memblock_set_bottom_up(false); |
| 2524 | | − alloc_try_nid_top_down_numa_part_reserved_check(); |
| 2535 | + alloc_nid_top_down_numa_part_reserved_check(); |
| 2525 | 2536 | memblock_set_bottom_up(true); |
| 2526 | | − alloc_try_nid_bottom_up_numa_part_reserved_check(); |
| 2537 | + alloc_nid_bottom_up_numa_part_reserved_check(); |
| 2527 | 2538 | |
| 2528 | 2539 | return 0; |
| 2529 | 2540 | } |
| 2530 | 2541 | |
| 2531 | | −static int alloc_try_nid_numa_part_reserved_fallback_check(void) |
| 2542 | +static int alloc_nid_numa_part_reserved_fallback_check(void) |
| 2532 | 2543 | { |
| 2533 | 2544 | test_print("\tRunning %s...\n", __func__); |
| 2534 | 2545 | memblock_set_bottom_up(false); |
| 2535 | | − alloc_try_nid_top_down_numa_part_reserved_fallback_check(); |
| 2546 | + alloc_nid_top_down_numa_part_reserved_fallback_check(); |
| 2536 | 2547 | memblock_set_bottom_up(true); |
| 2537 | | − alloc_try_nid_bottom_up_numa_part_reserved_fallback_check(); |
| 2548 | + alloc_nid_bottom_up_numa_part_reserved_fallback_check(); |
| 2538 | 2549 | |
| 2539 | 2550 | return 0; |
| 2540 | 2551 | } |
| 2541 | 2552 | |
| 2542 | | −static int alloc_try_nid_numa_split_range_low_check(void) |
| 2553 | +static int alloc_nid_numa_split_range_low_check(void) |
| 2543 | 2554 | { |
| 2544 | 2555 | test_print("\tRunning %s...\n", __func__); |
| 2545 | 2556 | memblock_set_bottom_up(false); |
| 2546 | | − alloc_try_nid_top_down_numa_split_range_low_check(); |
| 2557 | + alloc_nid_top_down_numa_split_range_low_check(); |
| 2547 | 2558 | memblock_set_bottom_up(true); |
| 2548 | | − alloc_try_nid_bottom_up_numa_split_range_low_check(); |
| 2559 | + alloc_nid_bottom_up_numa_split_range_low_check(); |
| 2549 | 2560 | |
| 2550 | 2561 | return 0; |
| 2551 | 2562 | } |
| 2552 | 2563 | |
| 2553 | | −static int alloc_try_nid_numa_split_range_high_check(void) |
| 2564 | +static int alloc_nid_numa_split_range_high_check(void) |
| 2554 | 2565 | { |
| 2555 | 2566 | test_print("\tRunning %s...\n", __func__); |
| 2556 | 2567 | memblock_set_bottom_up(false); |
| 2557 | | − alloc_try_nid_top_down_numa_split_range_high_check(); |
| 2568 | + alloc_nid_top_down_numa_split_range_high_check(); |
| 2558 | 2569 | memblock_set_bottom_up(true); |
| 2559 | | − alloc_try_nid_bottom_up_numa_split_range_high_check(); |
| 2570 | + alloc_nid_bottom_up_numa_split_range_high_check(); |
| 2560 | 2571 | |
| 2561 | 2572 | return 0; |
| 2562 | 2573 | } |
| 2563 | 2574 | |
| 2564 | | −static int alloc_try_nid_numa_no_overlap_split_check(void) |
| 2575 | +static int alloc_nid_numa_no_overlap_split_check(void) |
| 2565 | 2576 | { |
| 2566 | 2577 | test_print("\tRunning %s...\n", __func__); |
| 2567 | 2578 | memblock_set_bottom_up(false); |
| 2568 | | − alloc_try_nid_top_down_numa_no_overlap_split_check(); |
| 2579 | + alloc_nid_top_down_numa_no_overlap_split_check(); |
| 2569 | 2580 | memblock_set_bottom_up(true); |
| 2570 | | − alloc_try_nid_bottom_up_numa_no_overlap_split_check(); |
| 2581 | + alloc_nid_bottom_up_numa_no_overlap_split_check(); |
| 2571 | 2582 | |
| 2572 | 2583 | return 0; |
| 2573 | 2584 | } |
| 2574 | 2585 | |
| 2575 | | −static int alloc_try_nid_numa_no_overlap_low_check(void) |
| 2586 | +static int alloc_nid_numa_no_overlap_low_check(void) |
| 2576 | 2587 | { |
| 2577 | 2588 | test_print("\tRunning %s...\n", __func__); |
| 2578 | 2589 | memblock_set_bottom_up(false); |
| 2579 | | − alloc_try_nid_top_down_numa_no_overlap_low_check(); |
| 2590 | + alloc_nid_top_down_numa_no_overlap_low_check(); |
| 2580 | 2591 | memblock_set_bottom_up(true); |
| 2581 | | − alloc_try_nid_bottom_up_numa_no_overlap_low_check(); |
| 2592 | + alloc_nid_bottom_up_numa_no_overlap_low_check(); |
| 2582 | 2593 | |
| 2583 | 2594 | return 0; |
| 2584 | 2595 | } |
| 2585 | 2596 | |
| 2586 | | −static int alloc_try_nid_numa_no_overlap_high_check(void) |
| 2597 | +static int alloc_nid_numa_no_overlap_high_check(void) |
| 2587 | 2598 | { |
| 2588 | 2599 | test_print("\tRunning %s...\n", __func__); |
| 2589 | 2600 | memblock_set_bottom_up(false); |
| 2590 | | − alloc_try_nid_top_down_numa_no_overlap_high_check(); |
| 2601 | + alloc_nid_top_down_numa_no_overlap_high_check(); |
| 2591 | 2602 | memblock_set_bottom_up(true); |
| 2592 | | − alloc_try_nid_bottom_up_numa_no_overlap_high_check(); |
| 2603 | + alloc_nid_bottom_up_numa_no_overlap_high_check(); |
| 2593 | 2604 | |
| 2594 | 2605 | return 0; |
| 2595 | 2606 | } |
| 2596 | 2607 | |
| 2597 | | −static int alloc_try_nid_numa_large_region_check(void) |
| 2608 | +static int alloc_nid_numa_large_region_check(void) |
| 2598 | 2609 | { |
| 2599 | 2610 | test_print("\tRunning %s...\n", __func__); |
| 2600 | | − run_top_down(alloc_try_nid_numa_large_region_generic_check); |
| 2601 | | − run_bottom_up(alloc_try_nid_numa_large_region_generic_check); |
| 2611 | + run_top_down(alloc_nid_numa_large_region_generic_check); |
| 2612 | + run_bottom_up(alloc_nid_numa_large_region_generic_check); |
| 2602 | 2613 | |
| 2603 | 2614 | return 0; |
| 2604 | 2615 | } |
| 2605 | 2616 | |
| 2606 | | −static int alloc_try_nid_numa_reserved_full_merge_check(void) |
| 2617 | +static int alloc_nid_numa_reserved_full_merge_check(void) |
| 2607 | 2618 | { |
| 2608 | 2619 | test_print("\tRunning %s...\n", __func__); |
| 2609 | | − run_top_down(alloc_try_nid_numa_reserved_full_merge_generic_check); |
| 2610 | | − run_bottom_up(alloc_try_nid_numa_reserved_full_merge_generic_check); |
| 2620 | + run_top_down(alloc_nid_numa_reserved_full_merge_generic_check); |
| 2621 | + run_bottom_up(alloc_nid_numa_reserved_full_merge_generic_check); |
| 2611 | 2622 | |
| 2612 | 2623 | return 0; |
| 2613 | 2624 | } |
| 2614 | 2625 | |
| 2615 | | −static int alloc_try_nid_numa_split_all_reserved_check(void) |
| 2626 | +static int alloc_nid_numa_split_all_reserved_check(void) |
| 2616 | 2627 | { |
| 2617 | 2628 | test_print("\tRunning %s...\n", __func__); |
| 2618 | | − run_top_down(alloc_try_nid_numa_split_all_reserved_generic_check); |
| 2619 | | − run_bottom_up(alloc_try_nid_numa_split_all_reserved_generic_check); |
| 2629 | + run_top_down(alloc_nid_numa_split_all_reserved_generic_check); |
| 2630 | + run_bottom_up(alloc_nid_numa_split_all_reserved_generic_check); |
| 2620 | 2631 | |
| 2621 | 2632 | return 0; |
| 2622 | 2633 | } |
| @@ -2624,22 +2635,22 @@ static int alloc_try_nid_numa_split_all_reserved_check(void) · 1 unmodified line |
| 2624 | 2635 | int __memblock_alloc_nid_numa_checks(void) |
| 2625 | 2636 | { |
| 2626 | 2637 | test_print("Running %s NUMA tests...\n", |
| 2627 | | − get_memblock_alloc_try_nid_name(alloc_nid_test_flags)); |
| 2638 | + get_memblock_alloc_nid_name(alloc_nid_test_flags)); |
| 2628 | 2639 | |
| 2629 | | − alloc_try_nid_numa_simple_check(); |
| 2630 | | − alloc_try_nid_numa_small_node_check(); |
| 2631 | | − alloc_try_nid_numa_node_reserved_check(); |
| 2632 | | − alloc_try_nid_numa_part_reserved_check(); |
| 2633 | | − alloc_try_nid_numa_part_reserved_fallback_check(); |
| 2634 | | − alloc_try_nid_numa_split_range_low_check(); |
| 2635 | | − alloc_try_nid_numa_split_range_high_check(); |
| 2640 | + alloc_nid_numa_simple_check(); |
| 2641 | + alloc_nid_numa_small_node_check(); |
| 2642 | + alloc_nid_numa_node_reserved_check(); |
| 2643 | + alloc_nid_numa_part_reserved_check(); |
| 2644 | + alloc_nid_numa_part_reserved_fallback_check(); |
| 2645 | + alloc_nid_numa_split_range_low_check(); |
| 2646 | + alloc_nid_numa_split_range_high_check(); |
| 2636 | 2647 | |
| 2637 | | − alloc_try_nid_numa_no_overlap_split_check(); |
| 2638 | | − alloc_try_nid_numa_no_overlap_low_check(); |
| 2639 | | − alloc_try_nid_numa_no_overlap_high_check(); |
| 2640 | | − alloc_try_nid_numa_large_region_check(); |
| 2641 | | − alloc_try_nid_numa_reserved_full_merge_check(); |
| 2642 | | − alloc_try_nid_numa_split_all_reserved_check(); |
| 2648 | + alloc_nid_numa_no_overlap_split_check(); |
| 2649 | + alloc_nid_numa_no_overlap_low_check(); |
| 2650 | + alloc_nid_numa_no_overlap_high_check(); |
| 2651 | + alloc_nid_numa_large_region_check(); |
| 2652 | + alloc_nid_numa_reserved_full_merge_check(); |
| 2653 | + alloc_nid_numa_split_all_reserved_check(); |
| 2643 | 2654 | |
| 2644 | 2655 | return 0; |
| 2645 | 2656 | } |
| @@ -2649,7 +2660,7 @@ static int memblock_alloc_nid_checks_internal(int flags) · 3 unmodified lines |
| 2649 | 2660 | alloc_nid_test_flags = flags; |
| 2650 | 2661 | |
| 2651 | 2662 | prefix_reset(); |
| 2652 | | − prefix_push(get_memblock_alloc_try_nid_name(flags)); |
| 2663 | + prefix_push(get_memblock_alloc_nid_name(flags)); |
| 2653 | 2664 | |
| 2654 | 2665 | reset_memblock_attributes(); |
| 2655 | 2666 | dummy_physical_memory_init(); |
| @@ -2671,3 +2682,12 @@ int memblock_alloc_nid_checks(void) · 15 unmodified lines |
| 2671 | 2682 | |
| 2672 | 2683 | return 0; |
| 2673 | 2684 | } |
| 2685 | + |
| 2686 | +int memblock_alloc_exact_nid_range_checks(void) |
| 2687 | +{ |
| 2688 | + alloc_nid_test_flags = (TEST_F_RAW | TEST_F_EXACT); |
| 2689 | + |
| 2690 | + memblock_alloc_nid_range_checks(); |
| 2691 | + |
| 2692 | + return 0; |
| 2693 | +} |