/linux-6.6.21/tools/testing/selftests/mm/ |
D | madv_populate.c | 40 ret = madvise(addr, pagesize, MADV_POPULATE_READ); in sense_support() 44 ret = madvise(addr, pagesize, MADV_POPULATE_WRITE); in sense_support() 62 ret = madvise(addr, SIZE, MADV_POPULATE_READ); in test_prot_read() 65 ret = madvise(addr, SIZE, MADV_POPULATE_WRITE); in test_prot_read() 83 ret = madvise(addr, SIZE, MADV_POPULATE_READ); in test_prot_write() 87 ret = madvise(addr, SIZE, MADV_POPULATE_WRITE); in test_prot_write() 109 ret = madvise(addr, SIZE, MADV_POPULATE_READ); in test_holes() 112 ret = madvise(addr, SIZE, MADV_POPULATE_WRITE); in test_holes() 117 ret = madvise(addr, 2 * pagesize, MADV_POPULATE_READ); in test_holes() 120 ret = madvise(addr, 2 * pagesize, MADV_POPULATE_WRITE); in test_holes() [all …]
|
D | hugetlb-madvise.c | 135 ret = madvise(addr - base_page_size, NR_HUGE_PAGES * huge_page_size, in main() 144 ret = madvise(addr, (NR_HUGE_PAGES * huge_page_size) + base_page_size, in main() 169 ret = madvise(addr + base_page_size, in main() 179 if (madvise(addr, in main() 206 if (madvise(addr, NR_HUGE_PAGES * huge_page_size, MADV_DONTNEED)) { in main() 238 if (madvise(addr, NR_HUGE_PAGES * huge_page_size, MADV_DONTNEED)) { in main() 249 if (madvise(addr, NR_HUGE_PAGES * huge_page_size, MADV_DONTNEED)) { in main() 297 if (madvise(addr, NR_HUGE_PAGES * huge_page_size, MADV_DONTNEED)) { in main() 308 if (madvise(addr, NR_HUGE_PAGES * huge_page_size, MADV_REMOVE)) { in main() 353 if (madvise(addr, NR_HUGE_PAGES * huge_page_size, MADV_DONTNEED)) { in main() [all …]
|
D | ksm_functional_tests.c | 173 if (madvise(map, size, MADV_NOHUGEPAGE) && errno != EINVAL) { in mmap_and_merge_range() 195 } else if (madvise(map, size, MADV_MERGEABLE)) { in mmap_and_merge_range() 232 if (madvise(map, size, MADV_UNMERGEABLE)) { in test_unmerge() 278 if (madvise(map, size / 2, MADV_UNMERGEABLE)) { in test_unmerge_zero_pages() 319 if (madvise(map, size / 2, MADV_DONTNEED)) { in test_unmerge_discarded() 324 if (madvise(map, size, MADV_UNMERGEABLE)) { in test_unmerge_discarded() 384 if (madvise(map, size, MADV_UNMERGEABLE)) { in test_unmerge_uffd_wp() 526 if (madvise(map + size / 2, size / 2, MADV_UNMERGEABLE)) { in test_prot_none()
|
D | khugepaged.c | 588 ret = madvise(p, size, MADV_COLLAPSE); in madvise_collapse_retry() 622 if (madvise(p, hpage_pmd_size, MADV_HUGEPAGE)) { in alloc_hpage() 715 if (madvise(((char *)p) + start, end - start, MADV_POPULATE_READ)) { in file_fault() 809 madvise(p, nr_hpages * hpage_pmd_size, MADV_HUGEPAGE); in __madvise_collapse() 845 madvise(p, nr_hpages * hpage_pmd_size, MADV_HUGEPAGE); in wait_for_scan() 860 madvise(p, nr_hpages * hpage_pmd_size, MADV_NOHUGEPAGE); in wait_for_scan() 925 madvise(p, page_size, MADV_DONTNEED); in alloc_at_fault() 1011 if (madvise(p, page_size, MADV_PAGEOUT)) { in collapse_swapin_single_pte() 1038 if (madvise(p, (max_ptes_swap + 1) * page_size, MADV_PAGEOUT)) { in collapse_max_ptes_swap() 1057 if (madvise(p, max_ptes_swap * page_size, MADV_PAGEOUT)) { in collapse_max_ptes_swap() [all …]
|
D | cow.c | 691 ret = madvise(mem, pagesize, MADV_NOHUGEPAGE); in do_run_with_base_page() 702 madvise(mem, pagesize, MADV_PAGEOUT); in do_run_with_base_page() 755 ret = madvise(mem, thpsize, MADV_HUGEPAGE); in do_run_with_thp() 800 ret = madvise(mem + pagesize, thpsize - pagesize, MADV_DONTNEED); in do_run_with_thp() 833 ret = madvise(mem + pagesize, thpsize - pagesize, MADV_DONTFORK); in do_run_with_thp() 847 ret = madvise(mem + pagesize, thpsize - pagesize, MADV_DOFORK); in do_run_with_thp() 861 madvise(mem, size, MADV_PAGEOUT); in do_run_with_thp() 1166 ret = madvise(mem, size, MADV_COLLAPSE); in do_test_anon_thp_collapse() 1178 ret = madvise(mem + size / 2, size / 2, MADV_DONTFORK); in do_test_anon_thp_collapse() 1186 ret = madvise(mem, size / 2, MADV_DONTFORK); in do_test_anon_thp_collapse() [all …]
|
D | transhuge-stress.c | 76 if (madvise(ptr, len, MADV_HUGEPAGE)) in main() 116 if (madvise(p, HPAGE_SIZE - psize(), MADV_DONTNEED)) in main()
|
D | gup_test.c | 240 madvise(p, size, MADV_HUGEPAGE); in main() 242 madvise(p, size, MADV_NOHUGEPAGE); in main()
|
D | .gitignore | 7 hugetlb-madvise
|
D | uffd-unit-tests.c | 374 if (madvise(area_dst, page_size, MADV_DONTNEED)) in uffd_wp_unpopulated_test() 384 if (madvise(area_dst, page_size, MADV_DONTNEED)) in uffd_wp_unpopulated_test() 391 if (madvise(area_dst, page_size, MADV_DONTNEED)) in uffd_wp_unpopulated_test() 432 if (madvise(area_dst, page_size, MADV_DONTNEED)) in uffd_wp_fork_test_common() 439 madvise(area_dst, page_size, MADV_PAGEOUT); in uffd_wp_fork_test_common() 598 if (madvise(area_dst_alias, nr_pages * page_size, in uffd_minor_test_common()
|
D | split_huge_page_test.c | 104 madvise(one_page, len, MADV_HUGEPAGE); in split_pmd_thp() 167 madvise(one_page, len, MADV_HUGEPAGE); in split_pte_mapped_thp()
|
D | uffd-common.c | 43 if (madvise(rel_area, nr_pages * page_size, MADV_DONTNEED)) in anon_release_pages() 65 if (madvise(rel_area, nr_pages * page_size, MADV_DONTNEED)) in hugetlb_release_pages() 68 if (madvise(rel_area, nr_pages * page_size, MADV_REMOVE)) in hugetlb_release_pages() 119 if (madvise(rel_area, nr_pages * page_size, MADV_REMOVE)) in shmem_release_pages()
|
D | ksm_tests.c | 247 if (madvise(addr, size, MADV_MERGEABLE)) { in ksm_merge_pages() 271 if (madvise(addr, size, MADV_UNMERGEABLE)) { in ksm_unmerge_pages() 569 if (madvise(map_ptr, len, MADV_HUGEPAGE)) in ksm_merge_hugepages_time()
|
D | soft-dirty.c | 90 ret = madvise(map, hpage_len, MADV_HUGEPAGE); in test_hugepage()
|
D | protection_keys.c | 736 ret = madvise(ptr, HPAGE_SIZE, MADV_HUGEPAGE); in malloc_pkey_anon_huge() 738 ret = madvise(ptr, HPAGE_SIZE, MADV_WILLNEED); in malloc_pkey_anon_huge() 1465 madvise(p1, PAGE_SIZE, MADV_DONTNEED); in get_pointer_to_instructions() 1491 madvise(p1, PAGE_SIZE, MADV_DONTNEED); in test_executing_on_unreadable_memory() 1525 madvise(p1, PAGE_SIZE, MADV_DONTNEED); in test_implicit_mprotect_exec_only_memory()
|
D | migration.c | 191 ASSERT_EQ(madvise(ptr, TWOMEG, MADV_HUGEPAGE), 0);
|
D | vm_util.c | 163 if (madvise(ptr, HPAGE_SIZE, MADV_HUGEPAGE)) in allocate_transhuge()
|
/linux-6.6.21/Documentation/translations/zh_CN/admin-guide/mm/ |
D | ksm.rst | 35 以madvise控制KSM 38 KSM仅在特定的地址空间区域时运行,即应用程序通过使用如下所示的madvise(2)系统调 41 int madvise(addr, length, MADV_MERGEABLE) 45 int madvise(addr, length, MADV_UNMERGEABLE) 51 如果KSM未被配置到正在运行的内核中,则madvise MADV_MERGEABLE 和 MADV_UNMERGEABLE 58 当该进程将超过 ``vm.max_map_count`` 的设定,则madvise可能返回ENOMEM。(请参阅文档 61 与其他madvise调用一样,它们在用户地址空间的映射区域上使用:如果指定的范围包含未 174 味着不好的madvise-applied策略,所以开发者或管理员必须重新考虑如何改变madvis策 177 的比例在64位CPU上超过64,或者在32位CPU上超过128,那么应用程序的madvise策略应 185 是否或如何使用KSM。例如,如果cow_ksm增加得太快,用户可以减少madvise(, , MADV_MERGEABLE)
|
/linux-6.6.21/Documentation/translations/zh_CN/admin-guide/mm/damon/ |
D | usage.rst | 217 - ``willneed``: 对有 ``MADV_WILLNEED`` 的区域调用 ``madvise()`` 。 218 - ``cold``: 对具有 ``MADV_COLD`` 的区域调用 ``madvise()`` 。 219 - ``pageout``: 为具有 ``MADV_PAGEOUT`` 的区域调用 ``madvise()`` 。 220 - ``hugepage``: 为带有 ``MADV_HUGEPAGE`` 的区域调用 ``madvise()`` 。 221 - ``nohugepage``: 为带有 ``MADV_NOHUGEPAGE`` 的区域调用 ``madvise()``。 451 - 0: Call ``madvise()`` for the region with ``MADV_WILLNEED`` 452 - 1: Call ``madvise()`` for the region with ``MADV_COLD`` 453 - 2: Call ``madvise()`` for the region with ``MADV_PAGEOUT`` 454 - 3: Call ``madvise()`` for the region with ``MADV_HUGEPAGE`` 455 - 4: Call ``madvise()`` for the region with ``MADV_NOHUGEPAGE``
|
/linux-6.6.21/Documentation/admin-guide/mm/ |
D | ksm.rst | 30 Controlling KSM with madvise 34 has advised to be likely candidates for merging, by using the madvise(2) 37 int madvise(addr, length, MADV_MERGEABLE) 43 int madvise(addr, length, MADV_UNMERGEABLE) 50 If KSM is not configured into the running kernel, madvise MADV_MERGEABLE 59 or MADV_UNMERGEABLE region, the madvise may return ENOMEM if the process 62 Like other madvise calls, they are intended for use on mapped areas of 190 indicate poor use of madvise MADV_MERGEABLE. 229 ``ksm_merging_pages`` means a bad madvise-applied policy, so developers or 230 administrators have to rethink how to change madvise policy. Giving an example [all …]
|
D | transhuge.rst | 54 interface and using madvise(2) and prctl(2) system calls. 77 MADV_HUGEPAGE madvise regions. 79 Embedded systems should enable hugepages only inside madvise regions 85 madvise(MADV_HUGEPAGE) on their critical mmapped regions. 101 echo madvise >/sys/kernel/mm/transparent_hugepage/enabled 105 anonymous hugepages in case they're not immediately free to madvise 117 echo defer+madvise >/sys/kernel/mm/transparent_hugepage/defrag 118 echo madvise >/sys/kernel/mm/transparent_hugepage/defrag 134 defer+madvise 136 only for regions that have used madvise(MADV_HUGEPAGE); all [all …]
|
/linux-6.6.21/tools/testing/selftests/powerpc/tm/ |
D | tm-signal-context-force-tm.c | 69 ret = madvise(ucp->uc_link, sizeof(ucontext_t), MADV_DONTNEED); in usr_signal_handler() 138 if (madvise(ss.ss_sp, SIGSTKSZ, MADV_DONTNEED)) { in tm_trap_test()
|
/linux-6.6.21/arch/um/os-Linux/ |
D | process.c | 183 err = madvise(addr, length, MADV_REMOVE); in os_drop_memory() 210 if (madvise(addr, UM_KERN_PAGE_SIZE, MADV_REMOVE) != 0) { in can_drop_memory()
|
/linux-6.6.21/Documentation/admin-guide/mm/damon/ |
D | usage.rst | 283 - ``willneed``: Call ``madvise()`` for the region with ``MADV_WILLNEED``. 285 - ``cold``: Call ``madvise()`` for the region with ``MADV_COLD``. 287 - ``pageout``: Call ``madvise()`` for the region with ``MADV_PAGEOUT``. 289 - ``hugepage``: Call ``madvise()`` for the region with ``MADV_HUGEPAGE``. 291 - ``nohugepage``: Call ``madvise()`` for the region with ``MADV_NOHUGEPAGE``. 642 - 0: Call ``madvise()`` for the region with ``MADV_WILLNEED``. Ignored if 644 - 1: Call ``madvise()`` for the region with ``MADV_COLD``. Ignored if 646 - 2: Call ``madvise()`` for the region with ``MADV_PAGEOUT``. 647 - 3: Call ``madvise()`` for the region with ``MADV_HUGEPAGE``. Ignored if 649 - 4: Call ``madvise()`` for the region with ``MADV_NOHUGEPAGE``. Ignored if
|
/linux-6.6.21/tools/testing/selftests/arm64/mte/ |
D | check_ksm_options.c | 116 ret = madvise(ptr, TEST_UNIT * page_sz, MADV_MERGEABLE); in check_madvise_options()
|
/linux-6.6.21/Documentation/translations/zh_CN/mm/ |
D | hwpoison.rst | 102 * madvise(MADV_HWPOISON, ....) (as root) - 在测试过程中Poison一个页面
|