Lines Matching refs:pagesize
34 static size_t pagesize; variable
46 return __builtin_ctzll(size / pagesize); in sz2ord()
67 kb = (pagesize >> 10) << i; in detect_thp_sizes()
77 for (; size; addr += pagesize, size -= pagesize) in range_is_swapped()
778 mem = mmap(NULL, pagesize, PROT_READ | PROT_WRITE, in do_run_with_base_page()
786 ret = madvise(mem, pagesize, MADV_NOHUGEPAGE); in do_run_with_base_page()
795 memset(mem, 1, pagesize); in do_run_with_base_page()
798 madvise(mem, pagesize, MADV_PAGEOUT); in do_run_with_base_page()
806 fn(mem, pagesize, false); in do_run_with_base_page()
808 munmap(mem, pagesize); in do_run_with_base_page()
865 if (!pagemap_is_populated(pagemap_fd, mem + thpsize - pagesize)) { in do_run_with_thp()
885 ret = mprotect(mem + pagesize, pagesize, PROT_READ); in do_run_with_thp()
891 ret = mprotect(mem + pagesize, pagesize, PROT_READ | PROT_WRITE); in do_run_with_thp()
904 ret = madvise(mem + pagesize, thpsize - pagesize, MADV_DONTNEED); in do_run_with_thp()
910 size = pagesize; in do_run_with_thp()
940 ret = madvise(mem + pagesize, thpsize - pagesize, MADV_DONTFORK); in do_run_with_thp()
956 ret = madvise(mem + pagesize, thpsize - pagesize, MADV_DOFORK); in do_run_with_thp()
1286 ret = mprotect(mem + pagesize, pagesize, PROT_READ); in do_test_anon_thp_collapse()
1292 ret = mprotect(mem + pagesize, pagesize, PROT_READ | PROT_WRITE); in do_test_anon_thp_collapse()
1541 mem = mmap(NULL, pagesize, PROT_READ | PROT_WRITE, in run_with_zeropage()
1549 smem = mmap(NULL, pagesize, PROT_READ, MAP_PRIVATE | MAP_ANON, -1, 0); in run_with_zeropage()
1560 fn(mem, smem, pagesize); in run_with_zeropage()
1562 munmap(mem, pagesize); in run_with_zeropage()
1564 munmap(smem, pagesize); in run_with_zeropage()
1622 if (!pagemap_is_populated(pagemap_fd, mem + pagesize) || in run_with_huge_zeropage()
1623 !pagemap_is_populated(pagemap_fd, smem + pagesize)) { in run_with_huge_zeropage()
1650 if (fallocate(fd, 0, 0, pagesize)) { in run_with_memfd()
1657 mem = mmap(NULL, pagesize, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0); in run_with_memfd()
1663 smem = mmap(NULL, pagesize, PROT_READ, MAP_SHARED, fd, 0); in run_with_memfd()
1674 fn(mem, smem, pagesize); in run_with_memfd()
1676 munmap(mem, pagesize); in run_with_memfd()
1678 munmap(smem, pagesize); in run_with_memfd()
1706 if (fallocate(fd, 0, 0, pagesize)) { in run_with_tmpfile()
1713 mem = mmap(NULL, pagesize, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0); in run_with_tmpfile()
1719 smem = mmap(NULL, pagesize, PROT_READ, MAP_SHARED, fd, 0); in run_with_tmpfile()
1730 fn(mem, smem, pagesize); in run_with_tmpfile()
1732 munmap(mem, pagesize); in run_with_tmpfile()
1734 munmap(smem, pagesize); in run_with_tmpfile()
1866 pagesize = getpagesize(); in main()