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

Store classes not worth remembering per client for JITServer #10682

Merged
merged 1 commit into from
Sep 25, 2020

Conversation

dmitry-ten
Copy link
Contributor

@dmitry-ten dmitry-ten commented Sep 23, 2020

PR #10644 added a static array of classes not worth remembering
to Symbol Validation Manager. JITServer, however, requires this array
to be stored on a per client bases, since pointers to J9 classes
are different between clients.

@dmitry-ten dmitry-ten force-pushed the svm-jitserver-fix branch 4 times, most recently from be45c7c to 1977a74 Compare September 23, 2020 21:11
@dmitry-ten dmitry-ten marked this pull request as ready for review September 23, 2020 21:57
@dmitry-ten
Copy link
Contributor Author

@mpirvu this should fix #10663. I started the tests, will update when they complete.

Copy link
Contributor

@mpirvu mpirvu left a comment

Choose a reason for hiding this comment

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

It looks mostly ok. Please see the inline suggestions

runtime/compiler/control/JITClientCompilationThread.cpp Outdated Show resolved Hide resolved
runtime/compiler/runtime/SymbolValidationManager.hpp Outdated Show resolved Hide resolved
runtime/compiler/runtime/SymbolValidationManager.cpp Outdated Show resolved Hide resolved
runtime/compiler/runtime/SymbolValidationManager.cpp Outdated Show resolved Hide resolved
@mpirvu
Copy link
Contributor

mpirvu commented Sep 24, 2020

Not sure if this can be used to determine the number of elements in the array, since the array is defined in cpp while we need this definition in hpp:

template <typename T>
constexpr auto sizeof_array(const T& iarray) 
{
    return (sizeof(iarray) / sizeof(iarray[0]));
}

@dmitry-ten dmitry-ten force-pushed the svm-jitserver-fix branch 3 times, most recently from d36c0ff to a1a9de4 Compare September 24, 2020 17:59
@dmitry-ten
Copy link
Contributor Author

@mpirvu other than replacing vector with array, I addressed all comments.
Replacing vector with array requires creating a dynamically allocated array though, which needs default constructor. And to assign to that array, assignment operator is also needed. I'm not sure if the additional code would be worth it.
@dsouzai could you also take a look?

@mpirvu mpirvu added the comp:jitserver Artifacts related to JIT-as-a-Service project label Sep 24, 2020
@mpirvu mpirvu self-assigned this Sep 24, 2020
Copy link
Contributor

@mpirvu mpirvu left a comment

Choose a reason for hiding this comment

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

LGTM

@mpirvu
Copy link
Contributor

mpirvu commented Sep 24, 2020

We could use an embedded array if we knew the size. If the size of the original array cannot be statically determined, an workaround is to declare it as '2' in the hpp file and then to add a check at compile time that the number of entries in the cpp is actually 2. I'll let @dsouzai decide if he is ok with that change

@dsouzai
Copy link
Contributor

dsouzai commented Sep 24, 2020

Yeah looks ok to me.

If the size of the original array cannot be statically determined, an workaround is to declare it as '2' in the hpp file and then to add a check at compile time that the number of entries in the cpp is actually 2.

Yeah I'm ok with this since it'll be a compile time static assert, so it will at least get caught pretty early on.

@dmitry-ten dmitry-ten force-pushed the svm-jitserver-fix branch 2 times, most recently from a14b7a9 to b56aec7 Compare September 24, 2020 22:02
@dmitry-ten
Copy link
Contributor Author

@mpirvu changed vector to static array and removed the fix to front-end for getSystemClassFromSignature message.

@@ -637,9 +641,9 @@ class SymbolValidationManager

struct SystemClassNotWorthRemembering
{
const char * const _className;
char *_className;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can't we leave the first const here. The second one refers to the _className being immutable, but the first one refers to the string of characters being immutable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

True. I can push the change once the tests pass.

Copy link
Contributor

Choose a reason for hiding this comment

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

The tests on Power take very long for some reason, but on x86 they passed. You could do this change now.

@mpirvu
Copy link
Contributor

mpirvu commented Sep 25, 2020

jenkins test sanity plinuxjit,xlinuxjit jdk11

PR eclipse-openj9#10644 added a static array of classes not worth remembering
to Symbol Validation Manager. JITServer, however, requires this array
to be stored on a per client bases, since pointers to J9 classes
are different between clients.

Signed-off-by: Dmitry Ten <Dmitry.Ten@ibm.com>
@dmitry-ten
Copy link
Contributor Author

Pushed

@mpirvu
Copy link
Contributor

mpirvu commented Sep 25, 2020

jenkins test sanity plinuxjit,xlinuxjit jdk11

@mpirvu
Copy link
Contributor

mpirvu commented Sep 25, 2020

Testing on x86 was successful. Testing on Power seems to hand for some reason even though all the tests have passed. I don't know what the infra is waiting for.
I am going to merge this item since it addresses some serious breakage for JITServer.

@mpirvu mpirvu merged commit da5c187 into eclipse-openj9:master Sep 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:jitserver Artifacts related to JIT-as-a-Service project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants