Lines Matching full:smem
1503 typedef void (*non_anon_test_fn)(char *mem, const char *smem, size_t size);
1505 static void test_cow(char *mem, const char *smem, size_t size) in test_cow() argument
1510 memcpy(old, smem, size); in test_cow()
1516 if (!memcmp(smem, old, size)) { in test_cow()
1525 static void test_ro_pin(char *mem, const char *smem, size_t size) in test_ro_pin() argument
1530 static void test_ro_fast_pin(char *mem, const char *smem, size_t size) in test_ro_fast_pin() argument
1537 char *mem, *smem; in run_with_zeropage() local
1549 smem = mmap(NULL, pagesize, PROT_READ, MAP_PRIVATE | MAP_ANON, -1, 0); in run_with_zeropage()
1550 if (smem == MAP_FAILED) { in run_with_zeropage()
1558 FORCE_READ(*smem); in run_with_zeropage()
1560 fn(mem, smem, pagesize); in run_with_zeropage()
1563 if (smem != MAP_FAILED) in run_with_zeropage()
1564 munmap(smem, pagesize); in run_with_zeropage()
1569 char *mem, *smem, *mmap_mem, *mmap_smem; in run_with_huge_zeropage() local
1600 smem = (char *)(((uintptr_t)mmap_smem + pmdsize) & ~(pmdsize - 1)); in run_with_huge_zeropage()
1608 ret = madvise(smem, pmdsize, MADV_HUGEPAGE); in run_with_huge_zeropage()
1621 FORCE_READ(smem); in run_with_huge_zeropage()
1623 !pagemap_is_populated(pagemap_fd, smem + pagesize)) { in run_with_huge_zeropage()
1628 fn(mem, smem, pmdsize); in run_with_huge_zeropage()
1637 char *mem, *smem; in run_with_memfd() local
1663 smem = mmap(NULL, pagesize, PROT_READ, MAP_SHARED, fd, 0); in run_with_memfd()
1664 if (smem == MAP_FAILED) { in run_with_memfd()
1672 FORCE_READ(smem); in run_with_memfd()
1674 fn(mem, smem, pagesize); in run_with_memfd()
1677 if (smem != MAP_FAILED) in run_with_memfd()
1678 munmap(smem, pagesize); in run_with_memfd()
1685 char *mem, *smem; in run_with_tmpfile() local
1719 smem = mmap(NULL, pagesize, PROT_READ, MAP_SHARED, fd, 0); in run_with_tmpfile()
1720 if (smem == MAP_FAILED) { in run_with_tmpfile()
1728 FORCE_READ(smem); in run_with_tmpfile()
1730 fn(mem, smem, pagesize); in run_with_tmpfile()
1733 if (smem != MAP_FAILED) in run_with_tmpfile()
1734 munmap(smem, pagesize); in run_with_tmpfile()
1743 char *mem, *smem; in run_with_memfd_hugetlb() local
1773 smem = mmap(NULL, hugetlbsize, PROT_READ, MAP_SHARED, fd, 0); in run_with_memfd_hugetlb()
1774 if (smem == MAP_FAILED) { in run_with_memfd_hugetlb()
1782 FORCE_READ(smem); in run_with_memfd_hugetlb()
1784 fn(mem, smem, hugetlbsize); in run_with_memfd_hugetlb()
1787 if (smem != MAP_FAILED) in run_with_memfd_hugetlb()
1788 munmap(smem, hugetlbsize); in run_with_memfd_hugetlb()