Lines Matching full:ps

1243 pagesizes(size_t ps[MAXPAGESIZES])
1247 pscnt = getpagesizes(ps, MAXPAGESIZES);
1249 ATF_REQUIRE_MSG(ps[0] != 0, "psind 0 is %zu", ps[0]);
1261 size_t ps[MAXPAGESIZES];
1264 pscnt = pagesizes(ps);
1265 zeroes = calloc(1, ps[0]);
1268 fd = shm_open_large(i, SHM_LARGEPAGE_ALLOC_DEFAULT, ps[i]);
1270 addr = mmap(NULL, ps[i], PROT_READ | PROT_WRITE, MAP_SHARED, fd,
1273 "mmap(%zu bytes) failed; errno=%d", ps[i], errno);
1274 ATF_REQUIRE_MSG(((uintptr_t)addr & (ps[i] - 1)) == 0,
1276 ps[i], addr);
1281 vec = malloc(ps[i] / ps[0]);
1283 error = mincore(addr, ps[i], vec);
1287 for (size_t p = 0; p < ps[i] / ps[0]; p++) {
1293 p, ps[i]);
1297 for (size_t p = 0; p < ps[i] / ps[0]; p++) {
1298 ATF_REQUIRE_MSG(memcmp(addr + p * ps[0], zeroes,
1299 ps[0]) == 0, "page %zu miscompare", p);
1303 ATF_REQUIRE(munmap(addr, ps[i]) == 0);
1317 size_t ps[MAXPAGESIZES + 1]; /* silence warnings if MAXPAGESIZES == 1 */
1320 (void)pagesizes(ps);
1347 error = ftruncate(fd, ps[1]);
1351 addr = mmap(NULL, ps[1], PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
1358 buf = calloc(1, ps[0]);
1360 ATF_REQUIRE(write(fd, buf, ps[0]) == -1);
1363 buf = calloc(1, ps[1]);
1365 ATF_REQUIRE(write(fd, buf, ps[1]) == -1);
1369 error = posix_fallocate(fd, 0, ps[0]);
1379 size_t ps[MAXPAGESIZES];
1382 pscnt = pagesizes(ps);
1384 fd = shm_open_large(i, SHM_LARGEPAGE_ALLOC_DEFAULT, ps[i]);
1387 vec = malloc(ps[i]);
1393 addr = mmap(NULL, ps[i - 1], PROT_READ | PROT_WRITE, MAP_SHARED,
1396 "mmap(%zu bytes) succeeded", ps[i - 1]);
1398 "mmap(%zu bytes) failed; error=%d", ps[i - 1], errno);
1403 addr = mmap(NULL, ps[i], PROT_READ | PROT_WRITE, MAP_SHARED, fd,
1406 "mmap(%zu bytes) failed; errno=%d", ps[i], errno);
1407 ATF_REQUIRE_MSG(((uintptr_t)addr & (ps[i] - 1)) == 0,
1409 ps[i], addr);
1412 addr1 = mmap(addr, ps[i - 1], PROT_READ | PROT_WRITE,
1415 "anon mmap(%zu bytes) succeeded", ps[i - 1]);
1419 addr1 = mmap(addr, ps[i], PROT_READ | PROT_WRITE,
1422 "mmap(%zu bytes) succeeded", ps[i]);
1427 addr1 = mmap(addr, ps[i], PROT_READ | PROT_WRITE,
1430 "mmap(%zu bytes) failed; errno=%d", ps[i], errno);
1432 "mmap(%zu bytes) moved from %p to %p", ps[i], addr, addr1);
1434 ATF_REQUIRE(munmap(addr, ps[i] == 0));
1437 addr1 = mmap(NULL, ps[i], PROT_READ | PROT_WRITE,
1438 MAP_ANON | MAP_PRIVATE | MAP_ALIGNED(ffsl(ps[i]) - 1), -1,
1443 addr = mmap(addr1, ps[i], PROT_READ | PROT_WRITE,
1450 ATF_REQUIRE(mincore(addr, ps[i], vec) == 0);
1451 for (size_t p = 0; p < ps[i] / ps[0]; p++) {
1462 addr = mmap(NULL, ps[i], PROT_READ | PROT_WRITE, MAP_PRIVATE,
1465 "mmap(%zu bytes) succeeded", ps[i]);
1475 size_t ps[MAXPAGESIZES], ps1;
1478 pscnt = pagesizes(ps);
1480 fd = shm_open_large(i, SHM_LARGEPAGE_ALLOC_DEFAULT, ps[i]);
1481 ps1 = ps[i - 1];
1483 addr = mmap(NULL, ps[i], PROT_READ | PROT_WRITE, MAP_SHARED, fd,
1486 "mmap(%zu bytes) failed; errno=%d", ps[i], errno);
1492 ATF_REQUIRE(munmap(addr, ps[i] - ps1));
1502 ATF_REQUIRE(munmap(addr, ps[i]) == 0);
1526 size_t ps[MAXPAGESIZES];
1529 pscnt = pagesizes(ps);
1531 fd = shm_open_large(i, SHM_LARGEPAGE_ALLOC_DEFAULT, ps[i]);
1532 addr = mmap(NULL, ps[i], PROT_READ | PROT_WRITE, MAP_SHARED, fd,
1535 "mmap(%zu bytes) failed; error=%d", ps[i], errno);
1537 memset(addr, 0, ps[i]);
1540 largepage_madvise(addr, ps[0], MADV_NORMAL, EINVAL);
1541 largepage_madvise(addr, ps[i], MADV_NORMAL, 0);
1542 largepage_madvise(addr, ps[0], MADV_RANDOM, EINVAL);
1543 largepage_madvise(addr, ps[i], MADV_RANDOM, 0);
1544 largepage_madvise(addr, ps[0], MADV_SEQUENTIAL, EINVAL);
1545 largepage_madvise(addr, ps[i], MADV_SEQUENTIAL, 0);
1546 largepage_madvise(addr, ps[0], MADV_NOSYNC, EINVAL);
1547 largepage_madvise(addr, ps[i], MADV_NOSYNC, 0);
1548 largepage_madvise(addr, ps[0], MADV_AUTOSYNC, EINVAL);
1549 largepage_madvise(addr, ps[i], MADV_AUTOSYNC, 0);
1550 largepage_madvise(addr, ps[0], MADV_CORE, EINVAL);
1551 largepage_madvise(addr, ps[i], MADV_CORE, 0);
1552 largepage_madvise(addr, ps[0], MADV_NOCORE, EINVAL);
1553 largepage_madvise(addr, ps[i], MADV_NOCORE, 0);
1556 largepage_madvise(addr, ps[0], MADV_DONTNEED, 0);
1557 largepage_madvise(addr, ps[i], MADV_DONTNEED, 0);
1558 largepage_madvise(addr, ps[0], MADV_WILLNEED, 0);
1559 largepage_madvise(addr, ps[i], MADV_WILLNEED, 0);
1560 largepage_madvise(addr, ps[0], MADV_FREE, 0);
1561 largepage_madvise(addr, ps[i], MADV_FREE, 0);
1563 ATF_REQUIRE(munmap(addr, ps[i]) == 0);
1578 size_t ps[MAXPAGESIZES], sz;
1598 pscnt = pagesizes(ps);
1600 if (ps[i] / ps[0] > max_wired - wired) {
1605 fd = shm_open_large(i, SHM_LARGEPAGE_ALLOC_DEFAULT, ps[i]);
1606 addr = mmap(NULL, ps[i], PROT_READ | PROT_WRITE, MAP_SHARED, fd,
1609 "mmap(%zu bytes) failed; error=%d", ps[i], errno);
1611 ATF_REQUIRE(mlock(addr, ps[0]) != 0);
1613 "unexpected error %d from mlock(%zu bytes)", errno, ps[i]);
1614 ATF_REQUIRE(mlock(addr, ps[i] - ps[0]) != 0);
1616 "unexpected error %d from mlock(%zu bytes)", errno, ps[i]);
1618 ATF_REQUIRE_MSG(mlock(addr, ps[i]) == 0,
1621 ATF_REQUIRE(munmap(addr, ps[i]) == 0);
1624 addr = mmap(NULL, ps[i], PROT_READ | PROT_WRITE, MAP_SHARED, fd,
1627 "mmap(%zu bytes) failed; error=%d", ps[i], errno);
1629 ATF_REQUIRE(munmap(addr, ps[i]) == 0);
1638 size_t ps[MAXPAGESIZES];
1641 pscnt = pagesizes(ps);
1643 fd = shm_open_large(i, SHM_LARGEPAGE_ALLOC_DEFAULT, ps[i]);
1644 addr = mmap(NULL, ps[i], PROT_READ | PROT_WRITE, MAP_SHARED, fd,
1647 "mmap(%zu bytes) failed; error=%d", ps[i], errno);
1649 memset(addr, 0, ps[i]);
1655 ATF_REQUIRE_MSG(msync(addr, ps[0], MS_ASYNC) == 0,
1657 ATF_REQUIRE_MSG(msync(addr, ps[i], MS_ASYNC) == 0,
1659 ATF_REQUIRE_MSG(msync(addr, ps[0], MS_SYNC) == 0,
1661 ATF_REQUIRE_MSG(msync(addr, ps[i], MS_SYNC) == 0,
1664 ATF_REQUIRE_MSG(msync(addr, ps[0], MS_INVALIDATE) != 0,
1669 ATF_REQUIRE_MSG(msync(addr, ps[i], MS_INVALIDATE) == 0,
1671 memset(addr, 0, ps[i]);
1673 ATF_REQUIRE(munmap(addr, ps[i]) == 0);
1697 size_t ps[MAXPAGESIZES];
1700 pscnt = pagesizes(ps);
1706 addr = mmap(NULL, ps[i] * 2, PROT_NONE,
1707 MAP_ANON | MAP_ALIGNED(ffsl(ps[i]) - 1), -1, 0);
1709 "mmap(%zu bytes) failed; error=%d", ps[i], errno);
1710 ATF_REQUIRE(munmap(addr, ps[i] * 2) == 0);
1712 fd = shm_open_large(i, SHM_LARGEPAGE_ALLOC_DEFAULT, ps[i]);
1713 addr = mmap(addr, ps[i], PROT_READ | PROT_WRITE,
1716 "mmap(%zu bytes) failed; error=%d", ps[i], errno);
1722 largepage_protect(addr, ps[0], PROT_READ, EINVAL);
1723 largepage_protect(addr, ps[i], PROT_READ, 0);
1724 largepage_protect(addr, ps[0], PROT_NONE, EINVAL);
1725 largepage_protect(addr, ps[i], PROT_NONE, 0);
1726 largepage_protect(addr, ps[0],
1728 largepage_protect(addr, ps[i],
1733 largepage_protect(addr, ps[0], PROT_READ, EINVAL);
1734 largepage_protect(addr, ps[i], PROT_READ, 0);
1735 largepage_protect(addr, ps[0], PROT_NONE, EINVAL);
1736 largepage_protect(addr, ps[i], PROT_NONE, 0);
1737 largepage_protect(addr, ps[0],
1739 largepage_protect(addr, ps[i],
1742 memset(addr, 0, ps[i]);
1745 addr1 = mmap(addr + ps[i], ps[i], PROT_READ | PROT_WRITE,
1748 "mmap(%zu bytes) failed; error=%d", ps[i], errno);
1750 largepage_protect(addr1 - ps[0], ps[0] * 2,
1752 largepage_protect(addr, ps[i] * 2, PROT_READ | PROT_WRITE, 0);
1754 memset(addr, 0, ps[i] * 2);
1756 ATF_REQUIRE(munmap(addr, ps[i]) == 0);
1757 ATF_REQUIRE(munmap(addr1, ps[i]) == 0);
1766 size_t ps[MAXPAGESIZES];
1770 pscnt = pagesizes(ps);
1772 fd = shm_open_large(i, SHM_LARGEPAGE_ALLOC_DEFAULT, ps[i]);
1773 addr = mmap(NULL, ps[i], PROT_READ | PROT_WRITE, MAP_SHARED, fd,
1776 "mmap(%zu bytes) failed; error=%d", ps[i], errno);
1778 ATF_REQUIRE(minherit(addr, ps[0], INHERIT_SHARE) != 0);
1780 ATF_REQUIRE_MSG(minherit(addr, ps[i], INHERIT_SHARE) == 0,
1781 "minherit(%zu bytes) failed; error=%d", ps[i], errno);
1788 if (mincore(addr, ps[0], &v) != 0)
1801 ATF_REQUIRE_MSG(minherit(addr, ps[i], INHERIT_NONE) == 0,
1802 "minherit(%zu bytes) failed; error=%d", ps[i], errno);
1808 if (mincore(addr, ps[0], &v) == 0)
1820 ATF_REQUIRE_MSG(minherit(addr, ps[i], INHERIT_COPY) != 0,
1821 "minherit(%zu bytes) succeeded", ps[i]);
1823 ATF_REQUIRE_MSG(minherit(addr, ps[i], INHERIT_ZERO) == 0,
1824 "minherit(%zu bytes) failed; error=%d", ps[i], errno);
1831 if (mincore(addr, ps[0], &v) != 0)
1844 ATF_REQUIRE(munmap(addr, ps[i]) == 0);
1852 size_t ps[MAXPAGESIZES];
1858 pscnt = pagesizes(ps);
1861 fd = shm_open_large(i, SHM_LARGEPAGE_ALLOC_DEFAULT, ps[i]);
1862 addr = mmap(NULL, ps[i], PROT_READ | PROT_WRITE, MAP_SHARED, fd,
1865 "mmap(%zu bytes) failed; error=%d", ps[i], errno);
1878 for (resid = (size_t)ps[i]; resid > 0; resid -= len) {
1886 len = write(pfd[0], addr, ps[i]);
1888 ATF_REQUIRE_MSG(len == (ssize_t)ps[i],
1899 ATF_REQUIRE(munmap(addr, ps[i]) == 0);
1908 size_t ps[MAXPAGESIZES];
1911 (void)pagesizes(ps);
1921 ATF_REQUIRE_MSG(ftruncate(fd, ps[psind]) == 0,
1929 addr = mmap(NULL, ps[psind], PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
1935 vec = malloc(ps[psind] / ps[0]);
1937 ATF_REQUIRE_MSG(mincore(addr, ps[psind], vec) == 0,
1940 "page not mapped into a %zu-byte superpage", ps[psind]);