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

WIP:RamClass: Segment allocation enhancements #20896

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

h3110n3rv3
Copy link
Contributor

@h3110n3rv3 h3110n3rv3 commented Jan 9, 2025

The changes reflect the feature request #20644.

Adding segment categories for RAMClass fragments:
sub4G
Frequently accessed
Infrequently accessed

Closes: #20644
Signed-off-by: Nick Kamal <[email protected]>

runtime/oti/j9nonbuilder.h Outdated Show resolved Hide resolved
runtime/oti/j9nonbuilder.h Outdated Show resolved Hide resolved
runtime/vm/createramclass.cpp Outdated Show resolved Hide resolved
@h3110n3rv3 h3110n3rv3 changed the title RamClass: Segment allocation enhancements WIP:RamClass: Segment allocation enhancements Jan 9, 2025
@h3110n3rv3 h3110n3rv3 force-pushed the ramclass-changes branch 2 times, most recently from 8be826c to de5ff00 Compare January 20, 2025 17:16
@h3110n3rv3 h3110n3rv3 requested a review from tajila January 20, 2025 17:26
runtime/vm/createramclass.cpp Outdated Show resolved Hide resolved
runtime/jcl/common/mgmtmemory.c Outdated Show resolved Hide resolved
@@ -2997,17 +3017,18 @@ internalCreateRAMClassFromROMClassImpl(J9VMThread *vmThread, J9ClassLoader *clas
allocationRequests[RAM_CLASS_FLATTENED_CLASS_CACHE].alignment = OMR_MAX(sizeof(J9Class *), sizeof(UDATA));
allocationRequests[RAM_CLASS_FLATTENED_CLASS_CACHE].alignedSize = flattenedClassCacheAllocSize;
allocationRequests[RAM_CLASS_FLATTENED_CLASS_CACHE].address = NULL;
allocationRequests[RAM_CLASS_FLATTENED_CLASS_CACHE].segmentKind = SUB4G;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this sub4g?

@h3110n3rv3 h3110n3rv3 force-pushed the ramclass-changes branch 2 times, most recently from 9b66ef1 to 2ed701c Compare January 27, 2025 16:02
The changes reflect the feature request eclipse-openj9#20644.

Adding segment categories for RAMClass fragments:
sub4G
Frequently accessed
Infrequently accessed

Closes: eclipse-openj9#20644
Signed-off-by: Nick Kamal <[email protected]>
@@ -2925,67 +2934,78 @@ internalCreateRAMClassFromROMClassImpl(J9VMThread *vmThread, J9ClassLoader *clas
}
allocationRequests[RAM_SUPERCLASSES_FRAGMENT].alignedSize = OMR_MAX(superclassSizeBytes, minimumSuperclassArraySizeBytes);
allocationRequests[RAM_SUPERCLASSES_FRAGMENT].address = NULL;
allocationRequests[RAM_SUPERCLASSES_FRAGMENT].segmentKind = SUB4G;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if I don't put the shared class fragments in sub4g then these extended.openjdk tests fail: SharedClasses.SCM01.MultiThread_1,SharedClasses.SCM23.MultiThread_1


/* Add sizeof(UDATA) to hold the "lastAllocatedClass" pointer */
newSegmentSize += sizeof(UDATA);
if(!isNotLoadedByAnonClassLoader)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i have been trying to figure out how to deal with anonymous class fragments but I am stuck.
There is comment in cleanUpSegmentsInAnonymousClassLoader function that /* Anonymous classes expected to be allocated one per segment */. That function causes segfault without this code for one of the sanity.perf tests

@h3110n3rv3
Copy link
Contributor Author

all jenkins tests passing for the current shelve

@tajila
Copy link
Contributor

tajila commented Feb 3, 2025

@gacholio Please take a look

@tajila tajila requested a review from gacholio February 3, 2025 22:52
@gacholio
Copy link
Contributor

gacholio commented Feb 3, 2025

Has there been any testing or performance analysis on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RamClass: Segment allocation enhancements
3 participants