Lines Matching refs:nr_hpages

44 	void *(*setup_area)(int nr_hpages);
47 bool (*check_huge)(void *addr, int nr_hpages);
56 void (*collapse)(const char *msg, char *p, int nr_hpages,
643 static void *anon_setup_area(int nr_hpages)
645 return alloc_mapping(nr_hpages);
658 static bool anon_check_huge(void *addr, int nr_hpages)
660 return check_huge_anon(addr, nr_hpages, hpage_pmd_size);
663 static void *file_setup_area(int nr_hpages)
679 size = nr_hpages * hpage_pmd_size;
680 p = alloc_mapping(nr_hpages);
721 static bool file_check_huge(void *addr, int nr_hpages)
725 return check_huge_file(addr, nr_hpages, hpage_pmd_size);
727 return check_huge_shmem(addr, nr_hpages, hpage_pmd_size);
734 static void *shmem_setup_area(int nr_hpages)
737 unsigned long size = nr_hpages * hpage_pmd_size;
763 static bool shmem_check_huge(void *addr, int nr_hpages)
765 return check_huge_shmem(addr, nr_hpages, hpage_pmd_size);
792 static void __madvise_collapse(const char *msg, char *p, int nr_hpages,
809 madvise(p, nr_hpages * hpage_pmd_size, MADV_HUGEPAGE);
810 ret = madvise_collapse_retry(p, nr_hpages * hpage_pmd_size);
813 else if (!ops->check_huge(p, expect ? nr_hpages : 0))
821 static void madvise_collapse(const char *msg, char *p, int nr_hpages,
829 __madvise_collapse(msg, p, nr_hpages, ops, expect);
833 static bool wait_for_scan(const char *msg, char *p, int nr_hpages,
845 madvise(p, nr_hpages * hpage_pmd_size, MADV_HUGEPAGE);
852 if (ops->check_huge(p, nr_hpages))
860 madvise(p, nr_hpages * hpage_pmd_size, MADV_NOHUGEPAGE);
865 static void khugepaged_collapse(const char *msg, char *p, int nr_hpages,
868 if (wait_for_scan(msg, p, nr_hpages, ops)) {
882 ops->fault(p, 0, nr_hpages * hpage_pmd_size);
884 if (ops->check_huge(p, expect ? nr_hpages : 0))
937 int nr_hpages = 4;
938 unsigned long size = nr_hpages * hpage_pmd_size;
940 p = ops->setup_area(nr_hpages);
942 c->collapse("Collapse multiple fully populated PTE table", p, nr_hpages,
1355 int nr_hpages = 1;
1356 unsigned long size = nr_hpages * hpage_pmd_size;
1358 p = ops->setup_area(nr_hpages);
1362 if (wait_for_scan("Collapse and leave PMD cleared", p, nr_hpages,
1368 c->collapse("Install huge PMD from page cache", p, nr_hpages, ops,