Lines Matching refs:smem
1350 typedef void (*non_anon_test_fn)(char *mem, const char *smem, size_t size);
1352 static void test_cow(char *mem, const char *smem, size_t size) in test_cow() argument
1357 memcpy(old, smem, size); in test_cow()
1363 ksft_test_result(!memcmp(smem, old, size), in test_cow()
1368 static void test_ro_pin(char *mem, const char *smem, size_t size) in test_ro_pin() argument
1373 static void test_ro_fast_pin(char *mem, const char *smem, size_t size) in test_ro_fast_pin() argument
1380 char *mem, *smem, tmp; in run_with_zeropage() local
1391 smem = mmap(NULL, pagesize, PROT_READ, MAP_PRIVATE | MAP_ANON, -1, 0); in run_with_zeropage()
1398 tmp = *mem + *smem; in run_with_zeropage()
1401 fn(mem, smem, pagesize); in run_with_zeropage()
1404 if (smem != MAP_FAILED) in run_with_zeropage()
1405 munmap(smem, pagesize); in run_with_zeropage()
1410 char *mem, *smem, *mmap_mem, *mmap_smem, tmp; in run_with_huge_zeropage() local
1438 smem = (char *)(((uintptr_t)mmap_smem + thpsize) & ~(thpsize - 1)); in run_with_huge_zeropage()
1441 ret |= madvise(smem, thpsize, MADV_HUGEPAGE); in run_with_huge_zeropage()
1452 tmp = *mem + *smem; in run_with_huge_zeropage()
1455 !pagemap_is_populated(pagemap_fd, smem + pagesize)) { in run_with_huge_zeropage()
1460 fn(mem, smem, thpsize); in run_with_huge_zeropage()
1469 char *mem, *smem, tmp; in run_with_memfd() local
1492 smem = mmap(NULL, pagesize, PROT_READ, MAP_SHARED, fd, 0); in run_with_memfd()
1499 tmp = *mem + *smem; in run_with_memfd()
1502 fn(mem, smem, pagesize); in run_with_memfd()
1505 if (smem != MAP_FAILED) in run_with_memfd()
1506 munmap(smem, pagesize); in run_with_memfd()
1513 char *mem, *smem, tmp; in run_with_tmpfile() local
1543 smem = mmap(NULL, pagesize, PROT_READ, MAP_SHARED, fd, 0); in run_with_tmpfile()
1550 tmp = *mem + *smem; in run_with_tmpfile()
1553 fn(mem, smem, pagesize); in run_with_tmpfile()
1556 if (smem != MAP_FAILED) in run_with_tmpfile()
1557 munmap(smem, pagesize); in run_with_tmpfile()
1566 char *mem, *smem, tmp; in run_with_memfd_hugetlb() local
1593 smem = mmap(NULL, hugetlbsize, PROT_READ, MAP_SHARED, fd, 0); in run_with_memfd_hugetlb()
1600 tmp = *mem + *smem; in run_with_memfd_hugetlb()
1603 fn(mem, smem, hugetlbsize); in run_with_memfd_hugetlb()
1607 munmap(smem, hugetlbsize); in run_with_memfd_hugetlb()