Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expand j9vmemtest on Z/OS #8791

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions runtime/oti/j9port.h
Original file line number Diff line number Diff line change
Expand Up @@ -740,6 +740,7 @@ typedef struct J9CacheInfoQuery {
#define J9PORT_VMEM_ALLOC_DIR_BOTTOM_UP OMRPORT_VMEM_ALLOC_DIR_BOTTOM_UP
#define J9PORT_VMEM_STRICT_ADDRESS OMRPORT_VMEM_STRICT_ADDRESS
#define J9PORT_VMEM_PAGE_FLAG_PAGEABLE OMRPORT_VMEM_PAGE_FLAG_PAGEABLE
#define J9PORT_VMEM_PAGE_FLAG_PAGEABLE_PREFERABLE OMRPORT_VMEM_PAGE_FLAG_PAGEABLE_PREFERABLE
#define J9PORT_VMEM_PAGE_FLAG_FIXED OMRPORT_VMEM_PAGE_FLAG_FIXED
#define J9PORT_VMEM_PAGE_FLAG_NOT_USED OMRPORT_VMEM_PAGE_FLAG_NOT_USED
#define J9PORT_VMEM_STRICT_PAGE_SIZE OMRPORT_VMEM_STRICT_PAGE_SIZE
Expand Down
83 changes: 82 additions & 1 deletion runtime/tests/port/j9vmemTest.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 1991, 2019 IBM Corp. and others
* Copyright (c) 1991, 2020 IBM Corp. and others
*
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -3097,6 +3097,87 @@ j9vmem_testFindValidPageSize_impl(struct J9PortLibrary *portLibrary, char *testN
requestedPageSize, requestedPageFlags, isSizeSupported);
}

/* Test -XX:+UseLargePages option */
outputComment(PORTLIB, "\nCase %d: -XX:+UseLargePages\n", caseIndex++);
if (0 == defaultLargePageSize) {
outputComment(PORTLIB, "Skip this test as the configuration does not support default large page size\n");
}
else {
AlenBadel marked this conversation as resolved.
Show resolved Hide resolved
mode = 0;
requestedPageSize = 0;
requestedPageFlags = J9PORT_VMEM_PAGE_FLAG_PAGEABLE_PREFERABLE;
PRINT_FIND_VALID_PAGE_SIZE_INPUT(mode, requestedPageSize, requestedPageFlags);

j9vmem_default_large_page_size_ex(mode, &requestedPageSize, &requestedPageFlags);

expectedPageSize = ONE_MB;
expectedPageFlags = oneMBPageable? J9PORT_VMEM_PAGE_FLAG_PAGEABLE: J9PORT_VMEM_PAGE_FLAG_FIXED;
AlenBadel marked this conversation as resolved.
Show resolved Hide resolved

verifyFindValidPageSizeOutput(portLibrary, testName,
expectedPageSize, expectedPageFlags, 0,
requestedPageSize, requestedPageFlags, 0);
AlenBadel marked this conversation as resolved.
Show resolved Hide resolved
}

outputComment(PORTLIB, "\nCase %d: -XX:+UseLargePages with J9PORT_VMEM_MEMORY_MODE_EXECUTE\n", caseIndex++);
if (0 == defaultLargePageSize) {
outputComment(PORTLIB, "Skip this test as the configuration does not support default large page size\n");
}
else {
AlenBadel marked this conversation as resolved.
Show resolved Hide resolved
mode = J9PORT_VMEM_MEMORY_MODE_EXECUTE;
requestedPageSize = 0;
requestedPageFlags = J9PORT_VMEM_PAGE_FLAG_PAGEABLE_PREFERABLE;
PRINT_FIND_VALID_PAGE_SIZE_INPUT(mode, requestedPageSize, requestedPageFlags);

j9vmem_default_large_page_size_ex(mode, &requestedPageSize, &requestedPageFlags);

expectedPageSize = oneMBPageable? ONE_MB: 0;
AlenBadel marked this conversation as resolved.
Show resolved Hide resolved
expectedPageFlags = oneMBPageable? J9PORT_VMEM_PAGE_FLAG_PAGEABLE: J9PORT_VMEM_PAGE_FLAG_NOT_USED;
AlenBadel marked this conversation as resolved.
Show resolved Hide resolved

verifyFindValidPageSizeOutput(portLibrary, testName,
expectedPageSize, expectedPageFlags, 0,
AlenBadel marked this conversation as resolved.
Show resolved Hide resolved
requestedPageSize, requestedPageFlags, 0);
AlenBadel marked this conversation as resolved.
Show resolved Hide resolved
AlenBadel marked this conversation as resolved.
Show resolved Hide resolved
}

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

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

expectedPageSize = ONE_MB;
expectedPageFlags = oneMBPageable? J9PORT_VMEM_PAGE_FLAG_PAGEABLE: J9PORT_VMEM_PAGE_FLAG_FIXED;
AlenBadel marked this conversation as resolved.
Show resolved Hide resolved
expectedIsSizeSupported = TRUE;

verifyFindValidPageSizeOutput(portLibrary, testName,
expectedPageSize, expectedPageFlags, expectedIsSizeSupported,
requestedPageSize, requestedPageFlags, isSizeSupported);
AlenBadel marked this conversation as resolved.
Show resolved Hide resolved
}

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

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

expectedPageSize = oneMBPageable? ONE_MB: FOUR_KB;
AlenBadel marked this conversation as resolved.
Show resolved Hide resolved
expectedPageFlags = J9PORT_VMEM_PAGE_FLAG_PAGEABLE;
expectedIsSizeSupported = oneMBPageable? TRUE: FALSE;
AlenBadel marked this conversation as resolved.
Show resolved Hide resolved

verifyFindValidPageSizeOutput(portLibrary, testName,
expectedPageSize, expectedPageFlags, expectedIsSizeSupported,
requestedPageSize, requestedPageFlags, isSizeSupported);
AlenBadel marked this conversation as resolved.
Show resolved Hide resolved
}
#endif /* defined(J9VM_ENV_DATA64) */

_exit:
Expand Down