Lines Matching refs:NR_HUGE_PAGES
24 #define NR_HUGE_PAGES 10 /* common number of pages to map/allocate */ macro
115 addr = mmap(NULL, (NR_HUGE_PAGES + 2) * huge_page_size, in main()
124 munmap(addr + (NR_HUGE_PAGES + 1) * huge_page_size, in main()
131 write_fault_pages(addr, NR_HUGE_PAGES); in main()
132 validate_free_pages(free_hugepages - NR_HUGE_PAGES); in main()
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()
152 (void)munmap(addr, NR_HUGE_PAGES * huge_page_size); in main()
157 addr = mmap(NULL, NR_HUGE_PAGES * huge_page_size, in main()
165 write_fault_pages(addr, NR_HUGE_PAGES); in main()
166 validate_free_pages(free_hugepages - NR_HUGE_PAGES); in main()
170 NR_HUGE_PAGES * huge_page_size - base_page_size, in main()
180 ((NR_HUGE_PAGES - 1) * huge_page_size) + base_page_size, in main()
189 (void)munmap(addr, NR_HUGE_PAGES * huge_page_size); in main()
195 addr = mmap(NULL, NR_HUGE_PAGES * huge_page_size, in main()
203 write_fault_pages(addr, NR_HUGE_PAGES); in main()
204 validate_free_pages(free_hugepages - NR_HUGE_PAGES); in main()
206 if (madvise(addr, NR_HUGE_PAGES * huge_page_size, MADV_DONTNEED)) { in main()
214 (void)munmap(addr, NR_HUGE_PAGES * huge_page_size); in main()
219 if (fallocate(fd, 0, 0, NR_HUGE_PAGES * huge_page_size)) { in main()
223 validate_free_pages(free_hugepages - NR_HUGE_PAGES); in main()
225 addr = mmap(NULL, NR_HUGE_PAGES * huge_page_size, in main()
234 read_fault_pages(addr, NR_HUGE_PAGES); in main()
235 validate_free_pages(free_hugepages - NR_HUGE_PAGES); in main()
238 if (madvise(addr, NR_HUGE_PAGES * huge_page_size, MADV_DONTNEED)) { in main()
242 validate_free_pages(free_hugepages - NR_HUGE_PAGES); in main()
245 write_fault_pages(addr, NR_HUGE_PAGES); in main()
246 validate_free_pages(free_hugepages - (2 * NR_HUGE_PAGES)); in main()
249 if (madvise(addr, NR_HUGE_PAGES * huge_page_size, MADV_DONTNEED)) { in main()
253 validate_free_pages(free_hugepages - NR_HUGE_PAGES); in main()
256 write_fault_pages(addr, NR_HUGE_PAGES); in main()
257 validate_free_pages(free_hugepages - (2 * NR_HUGE_PAGES)); in main()
267 0, NR_HUGE_PAGES * huge_page_size)) { in main()
273 (void)munmap(addr, NR_HUGE_PAGES * huge_page_size); in main()
278 if (fallocate(fd, 0, 0, NR_HUGE_PAGES * huge_page_size)) { in main()
282 validate_free_pages(free_hugepages - NR_HUGE_PAGES); in main()
284 addr = mmap(NULL, NR_HUGE_PAGES * huge_page_size, in main()
293 write_fault_pages(addr, NR_HUGE_PAGES); in main()
294 validate_free_pages(free_hugepages - NR_HUGE_PAGES); in main()
297 if (madvise(addr, NR_HUGE_PAGES * huge_page_size, MADV_DONTNEED)) { in main()
301 validate_free_pages(free_hugepages - NR_HUGE_PAGES); in main()
308 if (madvise(addr, NR_HUGE_PAGES * huge_page_size, MADV_REMOVE)) { in main()
313 (void)munmap(addr, NR_HUGE_PAGES * huge_page_size); in main()
318 if (fallocate(fd, 0, 0, NR_HUGE_PAGES * huge_page_size)) { in main()
322 validate_free_pages(free_hugepages - NR_HUGE_PAGES); in main()
324 addr = mmap(NULL, NR_HUGE_PAGES * huge_page_size, in main()
333 write_fault_pages(addr, NR_HUGE_PAGES); in main()
334 validate_free_pages(free_hugepages - NR_HUGE_PAGES); in main()
336 addr2 = mmap(NULL, NR_HUGE_PAGES * huge_page_size, in main()
345 read_fault_pages(addr2, NR_HUGE_PAGES); in main()
346 validate_free_pages(free_hugepages - NR_HUGE_PAGES); in main()
349 write_fault_pages(addr2, NR_HUGE_PAGES); in main()
350 validate_free_pages(free_hugepages - (2 * NR_HUGE_PAGES)); in main()
353 if (madvise(addr, NR_HUGE_PAGES * huge_page_size, MADV_DONTNEED)) { in main()
357 validate_free_pages(free_hugepages - (2 * NR_HUGE_PAGES)); in main()
360 if (madvise(addr2, NR_HUGE_PAGES * huge_page_size, MADV_DONTNEED)) { in main()
364 validate_free_pages(free_hugepages - NR_HUGE_PAGES); in main()
367 write_fault_pages(addr2, NR_HUGE_PAGES); in main()
368 validate_free_pages(free_hugepages - (2 * NR_HUGE_PAGES)); in main()
375 if (madvise(addr, NR_HUGE_PAGES * huge_page_size, MADV_REMOVE)) { in main()
381 (void)munmap(addr, NR_HUGE_PAGES * huge_page_size); in main()
382 (void)munmap(addr2, NR_HUGE_PAGES * huge_page_size); in main()