Lines Matching refs:nr_hpages
53 void *(*setup_area)(int nr_hpages);
56 bool (*check_huge)(void *addr, int nr_hpages);
65 void (*collapse)(const char *msg, char *p, int nr_hpages,
652 static void *anon_setup_area(int nr_hpages) in anon_setup_area() argument
654 return alloc_mapping(nr_hpages); in anon_setup_area()
667 static bool anon_check_huge(void *addr, int nr_hpages) in anon_check_huge() argument
669 return check_huge_anon(addr, nr_hpages, hpage_pmd_size); in anon_check_huge()
672 static void *file_setup_area(int nr_hpages) in file_setup_area() argument
688 size = nr_hpages * hpage_pmd_size; in file_setup_area()
689 p = alloc_mapping(nr_hpages); in file_setup_area()
730 static bool file_check_huge(void *addr, int nr_hpages) in file_check_huge() argument
734 return check_huge_file(addr, nr_hpages, hpage_pmd_size); in file_check_huge()
736 return check_huge_shmem(addr, nr_hpages, hpage_pmd_size); in file_check_huge()
743 static void *shmem_setup_area(int nr_hpages) in shmem_setup_area() argument
746 unsigned long size = nr_hpages * hpage_pmd_size; in shmem_setup_area()
772 static bool shmem_check_huge(void *addr, int nr_hpages) in shmem_check_huge() argument
774 return check_huge_shmem(addr, nr_hpages, hpage_pmd_size); in shmem_check_huge()
801 static void __madvise_collapse(const char *msg, char *p, int nr_hpages, in __madvise_collapse() argument
818 madvise(p, nr_hpages * hpage_pmd_size, MADV_HUGEPAGE); in __madvise_collapse()
819 ret = madvise_collapse_retry(p, nr_hpages * hpage_pmd_size); in __madvise_collapse()
822 else if (!ops->check_huge(p, expect ? nr_hpages : 0)) in __madvise_collapse()
830 static void madvise_collapse(const char *msg, char *p, int nr_hpages, in madvise_collapse() argument
838 __madvise_collapse(msg, p, nr_hpages, ops, expect); in madvise_collapse()
842 static bool wait_for_scan(const char *msg, char *p, int nr_hpages, in wait_for_scan() argument
854 madvise(p, nr_hpages * hpage_pmd_size, MADV_HUGEPAGE); in wait_for_scan()
861 if (ops->check_huge(p, nr_hpages)) in wait_for_scan()
869 madvise(p, nr_hpages * hpage_pmd_size, MADV_NOHUGEPAGE); in wait_for_scan()
874 static void khugepaged_collapse(const char *msg, char *p, int nr_hpages, in khugepaged_collapse() argument
877 if (wait_for_scan(msg, p, nr_hpages, ops)) { in khugepaged_collapse()
891 ops->fault(p, 0, nr_hpages * hpage_pmd_size); in khugepaged_collapse()
893 if (ops->check_huge(p, expect ? nr_hpages : 0)) in khugepaged_collapse()
946 int nr_hpages = 4; in collapse_full() local
947 unsigned long size = nr_hpages * hpage_pmd_size; in collapse_full()
949 p = ops->setup_area(nr_hpages); in collapse_full()
951 c->collapse("Collapse multiple fully populated PTE table", p, nr_hpages, in collapse_full()
1364 int nr_hpages = 1; in madvise_retracted_page_tables() local
1365 unsigned long size = nr_hpages * hpage_pmd_size; in madvise_retracted_page_tables()
1367 p = ops->setup_area(nr_hpages); in madvise_retracted_page_tables()
1371 if (wait_for_scan("Collapse and leave PMD cleared", p, nr_hpages, in madvise_retracted_page_tables()
1377 c->collapse("Install huge PMD from page cache", p, nr_hpages, ops, in madvise_retracted_page_tables()