Skip to content

Commit

Permalink
Expand omrvmemtest on Z/OS
Browse files Browse the repository at this point in the history
Expanding the current tests to add cases where OMRPORT_VMEM_PAGE_FLAG_PREFER_PAGEABLE may be used.

Signed-off-by: AlenBadel <[email protected]>
  • Loading branch information
AlenBadel authored and AlenBadel committed Mar 16, 2020
1 parent be503a2 commit b8acc82
Showing 1 changed file with 80 additions and 0 deletions.
80 changes: 80 additions & 0 deletions fvtest/porttest/omrvmemTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3792,6 +3792,86 @@ omrvmem_testFindValidPageSize_impl(struct OMRPortLibrary *portLibrary, const cha
requestedPageSize, requestedPageFlags, isSizeSupported);
}

/* Test -XX:+UseLargePages option */
portTestEnv->log("\nCase %d: -XX:+UseLargePages\n", caseIndex++);
if (0 == defaultLargePageSize) {
portTestEnv->log("Skip this test as the configuration does not support default large page size\n");
} else {
mode = 0;
requestedPageSize = 0;
requestedPageFlags = OMRPORT_VMEM_PAGE_FLAG_PAGEABLE_PREFERABLE;
PRINT_FIND_VALID_PAGE_SIZE_INPUT(mode, requestedPageSize, requestedPageFlags);

omrvmem_default_large_page_size_ex(mode, &requestedPageSize, &requestedPageFlags);

expectedPageSize = ONE_MB;
expectedPageFlags = oneMBPageable ? OMRPORT_VMEM_PAGE_FLAG_PAGEABLE : OMRPORT_VMEM_PAGE_FLAG_FIXED;

verifyFindValidPageSizeOutput(
portLibrary, testName, expectedPageSize, expectedPageFlags,
FALSE, requestedPageSize, requestedPageFlags, FALSE);
}

portTestEnv->log("\nCase %d: -XX:+UseLargePages with OMRPORT_VMEM_MEMORY_MODE_EXECUTE\n", caseIndex++);
if (0 == defaultLargePageSize) {
portTestEnv->log("Skip this test as the configuration does not support default large page size\n");
} else {
mode = OMRPORT_VMEM_MEMORY_MODE_EXECUTE;
requestedPageSize = 0;
requestedPageFlags = OMRPORT_VMEM_PAGE_FLAG_PAGEABLE_PREFERABLE;
PRINT_FIND_VALID_PAGE_SIZE_INPUT(mode, requestedPageSize, requestedPageFlags);

omrvmem_default_large_page_size_ex(mode, &requestedPageSize, &requestedPageFlags);

expectedPageSize = oneMBPageable ? ONE_MB : 0;
expectedPageFlags = oneMBPageable ? OMRPORT_VMEM_PAGE_FLAG_PAGEABLE : OMRPORT_VMEM_PAGE_FLAG_NOT_USED;

verifyFindValidPageSizeOutput(
portLibrary, testName, expectedPageSize, expectedPageFlags,
FALSE, requestedPageSize, requestedPageFlags, FALSE);
}

/* Test -XX:LargePageInBytes=1M */
portTestEnv->log("\nCase %d: -XX:LargePageInBytes=1M\n", caseIndex++);
if (0 == defaultLargePageSize) {
portTestEnv->log("Skip this test as the configuration does not support default large page size\n");
} else {
mode = 0;
requestedPageSize = ONE_MB;
requestedPageFlags = OMRPORT_VMEM_PAGE_FLAG_PAGEABLE_PREFERABLE;
PRINT_FIND_VALID_PAGE_SIZE_INPUT(mode, requestedPageSize, requestedPageFlags);

omrvmem_find_valid_page_size(mode, &requestedPageSize, &requestedPageFlags, &isSizeSupported);

expectedPageSize = ONE_MB;
expectedPageFlags = oneMBPageable ? OMRPORT_VMEM_PAGE_FLAG_PAGEABLE : OMRPORT_VMEM_PAGE_FLAG_FIXED;
expectedIsSizeSupported = TRUE;

verifyFindValidPageSizeOutput(
portLibrary, testName, expectedPageSize, expectedPageFlags,
expectedIsSizeSupported, requestedPageSize, requestedPageFlags, isSizeSupported);
}

portTestEnv->log("\nCase %d: -XX:LargePageInBytes=1M with OMRPORT_VMEM_MEMORY_MODE_EXECUTE\n", caseIndex++);
if (0 == defaultLargePageSize) {
portTestEnv->log("Skip this test as the configuration does not support default large page size\n");
} else {
mode = OMRPORT_VMEM_MEMORY_MODE_EXECUTE;
requestedPageSize = ONE_MB;
requestedPageFlags = OMRPORT_VMEM_PAGE_FLAG_PAGEABLE_PREFERABLE;
PRINT_FIND_VALID_PAGE_SIZE_INPUT(mode, requestedPageSize, requestedPageFlags);

omrvmem_find_valid_page_size(mode, &requestedPageSize, &requestedPageFlags, &isSizeSupported);

expectedPageSize = oneMBPageable ? ONE_MB : FOUR_KB;
expectedPageFlags = OMRPORT_VMEM_PAGE_FLAG_PAGEABLE;
expectedIsSizeSupported = oneMBPageable;

verifyFindValidPageSizeOutput(
portLibrary, testName, expectedPageSize, expectedPageFlags,
expectedIsSizeSupported, requestedPageSize, requestedPageFlags, isSizeSupported);
}

#endif /* defined(OMR_ENV_DATA64) */

_exit:
Expand Down

0 comments on commit b8acc82

Please sign in to comment.