-
Notifications
You must be signed in to change notification settings - Fork 738
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
Add -Xlp:offheap: #21048
Merged
Merged
Add -Xlp:offheap: #21048
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -645,8 +645,13 @@ gcParseXlpOption(J9JavaVM *vm) | |
IDATA xlpGCIndex = -1; | ||
UDATA requestedPageSize = 0; | ||
UDATA requestedPageFlags = J9PORT_VMEM_PAGE_FLAG_NOT_USED; | ||
UDATA *pageSizes; | ||
UDATA *pageFlags; | ||
PORT_ACCESS_FROM_JAVAVM(vm); | ||
|
||
pageSizes = j9vmem_supported_page_sizes(); | ||
pageFlags = j9vmem_supported_page_flags(); | ||
|
||
/* Parse -Xlp option. | ||
* -Xlp option enables large pages with the default large page size, but will not | ||
* override any -Xlp<size> or -Xlp:objectheap:pagesize=<size> option. | ||
|
@@ -782,18 +787,16 @@ gcParseXlpOption(J9JavaVM *vm) | |
} | ||
|
||
/* | ||
* Check for -Xlp:gc: and handle it if necessary | ||
* Check for -Xlp:gcmetadata: and handle it if necessary | ||
*/ | ||
xlpGCIndex = FIND_AND_CONSUME_VMARG(STARTSWITH_MATCH, "-Xlp:gcmetadata:", NULL); | ||
|
||
if (-1 != xlpGCIndex) { | ||
UDATA gcmetadataPageSize = 0; | ||
UDATA gcmetadataPageFlags = J9PORT_VMEM_PAGE_FLAG_NOT_USED; | ||
UDATA *pageSizes; | ||
UDATA *pageFlags; | ||
bool found = false; | ||
/* | ||
* Parse sub options for -Xlp:gc: | ||
* Parse sub options for -Xlp:gcmetadata: | ||
*/ | ||
xlpErrorState = xlpSubOptionsParser(vm, xlpGCIndex, &xlpError, &gcmetadataPageSize, &gcmetadataPageFlags, NULL, NULL); | ||
|
||
|
@@ -809,15 +812,12 @@ gcParseXlpOption(J9JavaVM *vm) | |
/* | ||
* Update values in case of exact match only | ||
*/ | ||
pageSizes = j9vmem_supported_page_sizes(); | ||
pageFlags = j9vmem_supported_page_flags(); | ||
|
||
for (UDATA pageIndex = 0; 0 != pageSizes[pageIndex]; ++pageIndex) { | ||
if ((pageSizes[pageIndex] == gcmetadataPageSize) && (pageFlags[pageIndex] == gcmetadataPageFlags)) { | ||
found = true; | ||
extensions->gcmetadataPageSize = gcmetadataPageSize; | ||
extensions->gcmetadataPageFlags = gcmetadataPageFlags; | ||
break; | ||
break; | ||
} | ||
} | ||
|
||
|
@@ -834,6 +834,54 @@ gcParseXlpOption(J9JavaVM *vm) | |
} | ||
} | ||
|
||
/* | ||
* Check for -Xlp:offheap: and handle it if necessary | ||
*/ | ||
xlpGCIndex = FIND_AND_CONSUME_VMARG(STARTSWITH_MATCH, "-Xlp:offheap:", NULL); | ||
|
||
if (-1 != xlpGCIndex) { | ||
UDATA offheapPageSize = 0; | ||
UDATA offheapPageFlags = J9PORT_VMEM_PAGE_FLAG_NOT_USED; | ||
bool found = false; | ||
/* | ||
* Parse sub options for -Xlp:offheap: | ||
*/ | ||
xlpErrorState = xlpSubOptionsParser(vm, xlpGCIndex, &xlpError, &offheapPageSize, &offheapPageFlags, NULL, NULL); | ||
|
||
if (XLP_NO_ERROR != xlpErrorState) { | ||
goto _reportXlpError; | ||
} | ||
|
||
if (xlpError.extraCommaWarning) { | ||
/* print extra comma ignored warning */ | ||
j9nls_printf(PORTLIB, J9NLS_INFO, J9NLS_GC_OPTIONS_XLP_EXTRA_COMMA); | ||
} | ||
|
||
/* | ||
* Update values in case of exact match only | ||
*/ | ||
for (UDATA pageIndex = 0; 0 != pageSizes[pageIndex]; ++pageIndex) { | ||
if ((pageSizes[pageIndex] == offheapPageSize) && (pageFlags[pageIndex] == offheapPageFlags)) { | ||
found = true; | ||
extensions->sparseHeapPageSize = offheapPageSize; | ||
extensions->sparseHeapPageFlags = offheapPageFlags; | ||
break; | ||
} | ||
} | ||
|
||
if (!found) { | ||
const char *oldQualifier, *newQualifier; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. could initialize to null (for gcmetadata too) |
||
UDATA oldSize = offheapPageSize; | ||
UDATA newSize = extensions->sparseHeapPageSize; | ||
const char *oldPageType = getPageTypeStringWithLeadingSpace(oldSize); | ||
const char *newPageType = getPageTypeStringWithLeadingSpace(newSize); | ||
qualifiedSize(&oldSize, &oldQualifier); | ||
qualifiedSize(&newSize, &newQualifier); | ||
|
||
j9nls_printf(PORTLIB, J9NLS_INFO, J9NLS_GC_OPTIONS_XLP_PAGE_NOT_SUPPORTED, "offheap", oldSize, oldQualifier, oldPageType, newSize, newQualifier, newPageType); | ||
} | ||
} | ||
|
||
_reportXlpError: | ||
/* If error occurred during parsing of -Xlp options, report it here. */ | ||
if (XLP_NO_ERROR != xlpErrorState) { | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could initialize at definition line