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

JITServer on Z build fixes #10688

Merged
merged 4 commits into from
Sep 25, 2020

Conversation

dchopra001
Copy link
Contributor

This PR fixes 3 bugs for JITServer on Z that were seen in cmdLineTester_fieldwatchtests_0, MauveMultiThreadLoadTest_0, and _stringConcatOptTest_0. The reasoning for each fix is described in the individual commit messages.

For relocatable compiles such as remote compilations,
fieldwatch should not generate PC relative instructions
because it is not supported.

Signed-off-by: Dhruv Chopra <Dhruv.C.Chopra@ibm.com>
When looking for the java/lang/Object class by name in the
TR::ArrayStoreCHK evaluator, isVettedForAOT was set to false
for remote compilations. This is incorrect and we shouldn't
restrict this. Moreover, it can prevent CLGRL from
being generated when it should be generated.

Signed-off-by: Dhruv Chopra <Dhruv.C.Chopra@ibm.com>
@dchopra001
Copy link
Contributor Author

Tagging @fjeremic and @mpirvu for review.

@fjeremic fjeremic self-assigned this Sep 24, 2020
@fjeremic fjeremic added arch:z comp:jitserver Artifacts related to JIT-as-a-Service project labels Sep 24, 2020
For the VM_getSystemClassFromClassName JITServer message type,
the base implementation of getSystemClassFromClassName should
always be called, even for AOT compilations. This is because
the validation is done on the server.

Signed-off-by: Dhruv Chopra <Dhruv.C.Chopra@ibm.com>
Signed-off-by: Dhruv Chopra <Dhruv.C.Chopra@ibm.com>
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

@dchopra001
Copy link
Contributor Author

Since the JITServer builds are failing due to a separate issue, I'll run the JITServer builds locally on a z14 machine and post the results here. I'll post details about the branches I used here as well. We can do regular build testing here to make sure these changes are safe on OpenJ9.

@fjeremic
Copy link
Contributor

Jenkins test sanity zlinux jdk8,jdk11

@mpirvu
Copy link
Contributor

mpirvu commented Sep 25, 2020

Tests have passed, so this PR is ready for merging

@fjeremic fjeremic merged commit ae774e5 into eclipse-openj9:master Sep 25, 2020
@dchopra001
Copy link
Contributor Author

The JITServer builds I ran locally look clean. Here are the commits I used to build the JVM:

OpenJ9: 8001eda
OMR: 5f5f8a1
openj9-openjdk-jdk8: 182efd2724169a1c67f04707ace98106a13dfd45

And the following extra commit was added on top to openj9 (i.e. the changes in this PR):

diff --git a/runtime/compiler/control/JITClientCompilationThread.cpp b/runtime/compiler/control/JITClientCompilationThread.cpp
index ea368fc1f..e1c113343 100644
--- a/runtime/compiler/control/JITClientCompilationThread.cpp
+++ b/runtime/compiler/control/JITClientCompilationThread.cpp
@@ -258,7 +258,8 @@ handleServerMessage(JITServer::ClientStream *client, TR_J9VM *fe, JITServer::Mes
          auto recv = client->getRecvData<std::string, bool>();
          const std::string name = std::get<0>(recv);
          bool isVettedForAOT = std::get<1>(recv);
-         client->write(response, fe->getSystemClassFromClassName(name.c_str(), name.length(), isVettedForAOT));
+        TR_J9VMBase *fej9 = TR_J9VMBase::get(vmThread->javaVM->jitConfig, vmThread);
+        client->write(response, fej9->getSystemClassFromClassName(name.c_str(), name.length(), isVettedForAOT));
          }
          break;
       case MessageType::VM_isMethodTracingEnabled:
diff --git a/runtime/compiler/z/codegen/J9TreeEvaluator.cpp b/runtime/compiler/z/codegen/J9TreeEvaluator.cpp
index 677e9801f..9fc7e2ff0 100644
--- a/runtime/compiler/z/codegen/J9TreeEvaluator.cpp
+++ b/runtime/compiler/z/codegen/J9TreeEvaluator.cpp
@@ -4002,7 +4002,7 @@ J9::Z::TreeEvaluator::generateTestAndReportFieldWatchInstructions(TR::CodeGenera
       if (isResolved)
          {
          fieldClassReg = cg->allocateRegister();
-         if (!(cg->needClassAndMethodPointerRelocations()))
+         if (!(cg->needClassAndMethodPointerRelocations()) && cg->canUseRelativeLongInstructions(reinterpret_cast<int64_t>((static_cast<TR::J9WatchedStaticFieldSnippet *>(dataSnippet)->getFieldClass()))))
             {
             // For non-AOT (JIT and JITServer) compiles we don't need to use sideEffectRegister here as the class information is available to us at compile time.
             J9Class *fieldClass = static_cast<TR::J9WatchedStaticFieldSnippet *>(dataSnippet)->getFieldClass();
@@ -4822,7 +4822,9 @@ VMarrayStoreCHKEvaluator(
    if (debugObj)
       debugObj->addInstructionComment(cursor, "Check if src.type == array.type");

-   intptr_t objectClass = (intptr_t) fej9->getSystemClassFromClassName("java/lang/Object", 16, !cg->comp()->isOutOfProcessCompilation());
+   intptr_t objectClass = (intptr_t) fej9->getSystemClassFromClassName("java/lang/Object", 16, true);
    /*
     * objectClass is used for Object arrays check optimization: when we are storing to Object arrays we can skip all other array store checks
     * However, TR_J9SharedCacheVM::getSystemClassFromClassName can return 0 when it's impossible to relocate j9class later for AOT loads

There were infra/non-JITServer related failures in the builds. I've summarized them below:

sanity.functional:

FAILED test targets:
        cmdLineTester_pltest_0 - known failure, happens without JITServer
        JCL_Test_OutOfMemoryError_SE80_0 - Not a real failure (See [1] for more context)

sanity.system:

FAILED test targets:
        TestJlmRemoteClassNoAuth_SE80_Linux_0 - These are all reproducible without JITServer
        TestJlmRemoteMemoryAuth_SE80_Linux_0
        TestJlmRemoteMemoryNoAuth_SE80_Linux_0
        TestJlmRemoteThreadNoAuth_SE80_Linux_0
        TestIBMJlmRemoteMemoryAuth_SE80_Linux_0
        TestIBMJlmRemoteMemoryNoAuth_SE80_Linux_0

extended.functional:

FAILED test targets:
        cmdLineTester_pltest_j9sig_ext_0 - reproducible without JITServer
        testSCCMLTests3_1 - Not able to reproduce on 30 repetitions, so this looks like a one-off failure or infra issue.
        testSCCMLSnapshot_1 - infra issue with the test not being able to `touch` the cache properly during test startup
        testSoftMxUserScenario_2 - Fails without JITServer as well.

extended.system:

No failures

[1] These types of failures happen occasionally on JITServer builds when I run with the TR_RequireJITServer option (which is an untested debugging option). These look infra related as well and don't look tied to any functional correctness issue on Z. The issues are never reproducible (especially when running without the debugging option TR_RequireJITServer) on a particular test. It could also be a timeout issue as some of these tests run for a very long time. Finally, subsequent tests run successfully, proving that the JITServer didn't crash or stop responding because the TR_RequireJITServer option is still set.

I'm attaching the results files for the above tests here.
sanitySystemOutput.txt
sanityFunctionalOutput.txt
extendedFunctionalOutput.txt
extendedSystemOutput.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arch:z comp:jitserver Artifacts related to JIT-as-a-Service project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants