Lines Matching full:smem
1443 typedef void (*non_anon_test_fn)(char *mem, const char *smem, size_t size);
1445 static void test_cow(char *mem, const char *smem, size_t size) in test_cow() argument
1450 memcpy(old, smem, size); in test_cow()
1456 ksft_test_result(!memcmp(smem, old, size), in test_cow()
1461 static void test_ro_pin(char *mem, const char *smem, size_t size) in test_ro_pin() argument
1466 static void test_ro_fast_pin(char *mem, const char *smem, size_t size) in test_ro_fast_pin() argument
1473 char *mem, *smem, tmp; in run_with_zeropage() local
1484 smem = mmap(NULL, pagesize, PROT_READ, MAP_PRIVATE | MAP_ANON, -1, 0); in run_with_zeropage()
1485 if (smem == MAP_FAILED) { in run_with_zeropage()
1491 tmp = *mem + *smem; in run_with_zeropage()
1494 fn(mem, smem, pagesize); in run_with_zeropage()
1497 if (smem != MAP_FAILED) in run_with_zeropage()
1498 munmap(smem, pagesize); in run_with_zeropage()
1503 char *mem, *smem, *mmap_mem, *mmap_smem, tmp; in run_with_huge_zeropage() local
1531 smem = (char *)(((uintptr_t)mmap_smem + pmdsize) & ~(pmdsize - 1)); in run_with_huge_zeropage()
1534 ret |= madvise(smem, pmdsize, MADV_HUGEPAGE); in run_with_huge_zeropage()
1545 tmp = *mem + *smem; in run_with_huge_zeropage()
1548 !pagemap_is_populated(pagemap_fd, smem + pagesize)) { in run_with_huge_zeropage()
1553 fn(mem, smem, pmdsize); in run_with_huge_zeropage()
1562 char *mem, *smem, tmp; in run_with_memfd() local
1585 smem = mmap(NULL, pagesize, PROT_READ, MAP_SHARED, fd, 0); in run_with_memfd()
1586 if (smem == MAP_FAILED) { in run_with_memfd()
1592 tmp = *mem + *smem; in run_with_memfd()
1595 fn(mem, smem, pagesize); in run_with_memfd()
1598 if (smem != MAP_FAILED) in run_with_memfd()
1599 munmap(smem, pagesize); in run_with_memfd()
1606 char *mem, *smem, tmp; in run_with_tmpfile() local
1636 smem = mmap(NULL, pagesize, PROT_READ, MAP_SHARED, fd, 0); in run_with_tmpfile()
1637 if (smem == MAP_FAILED) { in run_with_tmpfile()
1643 tmp = *mem + *smem; in run_with_tmpfile()
1646 fn(mem, smem, pagesize); in run_with_tmpfile()
1649 if (smem != MAP_FAILED) in run_with_tmpfile()
1650 munmap(smem, pagesize); in run_with_tmpfile()
1659 char *mem, *smem, tmp; in run_with_memfd_hugetlb() local
1686 smem = mmap(NULL, hugetlbsize, PROT_READ, MAP_SHARED, fd, 0); in run_with_memfd_hugetlb()
1687 if (smem == MAP_FAILED) { in run_with_memfd_hugetlb()
1693 tmp = *mem + *smem; in run_with_memfd_hugetlb()
1696 fn(mem, smem, hugetlbsize); in run_with_memfd_hugetlb()
1699 if (smem != MAP_FAILED) in run_with_memfd_hugetlb()
1700 munmap(smem, hugetlbsize); in run_with_memfd_hugetlb()