Skip to content

8300139 : [AIX] Use pthreads to avoid JNI_createVM call from primordial thread #12302

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

Closed
wants to merge 8 commits into from

Conversation

varada1110
Copy link
Contributor

@varada1110 varada1110 commented Jan 31, 2023

  1. test/jdk/jni/nullCaller/NullCallerTest.java

  2. test/jdk/java/lang/reflect/exeCallerAccessTest/CallerAccessTest.java

  3. test/hotspot/jtreg/runtime/jni/CalleeSavedRegisters/FPRegs.java

    The above tests were blocked on AIX [@require os.family != "aix"] because these tests are failing to call JNI_CreateJavaVM. This is solved by implementing JNI_CreateJavaVM call via POSIX threads.
    Similarly there are tests which are not blocked and still failing to call JNI_CreateJavaVM on AIX :

  4. test/hotspot/jtreg/runtime/jni/daemonDestroy/TestDaemonDestroy.java { PR : 12006 }

  5. test/lib-test/jdk/test/lib/process/TestNativeProcessBuilder.java

The reported issue : 8300139


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8300139: [AIX] Use pthreads to avoid JNI_createVM call from primordial thread

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/12302/head:pull/12302
$ git checkout pull/12302

Update a local copy of the PR:
$ git checkout pull/12302
$ git pull https://git.openjdk.org/jdk pull/12302/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 12302

View PR using the GUI difftool:
$ git pr show -t 12302

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/12302.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Jan 31, 2023

👋 Welcome back varada1110! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Jan 31, 2023

@varada1110 The following labels will be automatically applied to this pull request:

  • core-libs
  • hotspot-runtime

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added hotspot-runtime hotspot-runtime-dev@openjdk.org core-libs core-libs-dev@openjdk.org labels Jan 31, 2023
@varada1110 varada1110 changed the title 8300139:[AIX] Use pthreads to avoid JNI_createVM call from primordial thread 8300139: [AIX] Use pthreads to avoid JNI_createVM call from primordial thread Feb 1, 2023
@varada1110 varada1110 changed the title 8300139: [AIX] Use pthreads to avoid JNI_createVM call from primordial thread 8300139 : [AIX] Use pthreads to avoid JNI_createVM call from primordial thread Feb 1, 2023
@varada1110 varada1110 marked this pull request as ready for review February 8, 2023 05:22
@openjdk openjdk bot added the rfr Pull request is ready for review label Feb 8, 2023
@mlbridge
Copy link

mlbridge bot commented Feb 8, 2023

Webrevs

Copy link
Member

@dholmes-ora dholmes-ora left a comment

Choose a reason for hiding this comment

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

I hate to see the code duplication, but we don't have a sharing mechanism for the native parts of tests so that can't be helped.

Changes look good.

Please update the Oracle copyright lines so that the second year is 2023 if needed. Thanks.

@openjdk
Copy link

openjdk bot commented Feb 8, 2023

@varada1110 This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8300139: [AIX] Use pthreads to avoid JNI_createVM call from primordial thread

Reviewed-by: dholmes, stuefe

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 210 new commits pushed to the master branch:

  • d1c87a0: 8302203: IR framework should detect non-compilable test methods early
  • 1fec6b5: 8301852: RISC-V: Optimize class atomic when order is memory_order_relaxed
  • 7c233bc: 8302114: RISC-V: Several foreign jtreg tests fail with debug build after JDK-8301818
  • 8049e59: 8301833: Add wide-ranging tests for FDLIBM porting
  • 6a44120: 8301269: Update Commons BCEL to Version 6.7.0
  • 6f9f2b5: 8301737: java/rmi/server/UnicastRemoteObject/serialFilter/FilterUROTest.java fail with -Xcomp
  • 1ef9f65: 8302172: [JVMCI] HotSpotResolvedJavaMethodImpl.canBeInlined must respect ForceInline
  • 74b167b: 8301819: Enable continuations code by default
  • 919a6da: 8301202: Port fdlibm log to Java
  • 98e98e9: 8296322: javac: use methods to manage parser mode flags
  • ... and 200 more: https://git.openjdk.org/jdk/compare/c672ed16f363d9c92ccefe2e64a96e0a60a49588...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@dholmes-ora, @tstuefe) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Feb 8, 2023
@varada1110
Copy link
Contributor Author

I hate to see the code duplication, but we don't have a sharing mechanism for the native parts of tests so that can't be helped.

Changes look good.

Please update the Oracle copyright lines so that the second year is 2023 if needed. Thanks.

Thanks @dholmes-ora . I will update Oracle copyright lines.

@tstuefe
Copy link
Member

tstuefe commented Feb 8, 2023

I hate to see the code duplication, but we don't have a sharing mechanism for the native parts of tests so that can't be helped.

It may be interesting to invest some time to find out if the "don't start on primordial thread" rule still holds on modern AIX versions.

I added this rule 18 years ago with our original (internal) AIX port because - IIRC - we were unable to find out the stack dimensions of the primordial thread, and we could not place guard pages reliably. And maybe some other problems too; the primordial thread behaved a lot different from pthread back then.

Maybe modern AIX variants don't have that problem anymore. We could cut down all this coding.

Cheers, Thomas

@dholmes-ora
Copy link
Member

It just occurred to me that we may also need to update the test makefiles to link to libpthread for these modified tests?

@varada1110
Copy link
Contributor Author

It just occurred to me that we may also need to update the test makefiles to link to libpthread for these modified tests?

Running test 'jtreg:test/hotspot/jtreg/runtime/jni/CalleeSavedRegisters/FPRegs.java'
Passed: runtime/jni/CalleeSavedRegisters/FPRegs.java
Test results: passed: 1

Running test 'jtreg:test/jdk/java/lang/reflect/exeCallerAccessTest/CallerAccessTest.java'
Passed: java/lang/reflect/exeCallerAccessTest/CallerAccessTest.java
Test results: passed: 1

Running test 'jtreg:test/jdk/jni/nullCaller/NullCallerTest.java'
Passed: jni/nullCaller/NullCallerTest.java
Test results: passed: 1

Running test 'jtreg:test/lib-test/jdk/test/lib/process/TestNativeProcessBuilder.java'
Passed: jdk/test/lib/process/TestNativeProcessBuilder.java
Test results: passed: 1

These tests is passing without adding lpthread in JtregNativeHotspot.gmk. Do I need to update the makefile?

Copy link
Member

@tstuefe tstuefe left a comment

Choose a reason for hiding this comment

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

Small nits remain, nothing major.

Copy link
Member

@tstuefe tstuefe left a comment

Choose a reason for hiding this comment

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

Looks good to me. Thanks.

@dholmes-ora
Copy link
Member

These tests is passing without adding lpthread in JtregNativeHotspot.gmk. Do I need to update the makefile?

I'm somewhat surprised that the tests pass without explicit linkage, but perhaps libpthread is a default on AIX. If things are working in your AIX testing then that is fine.

@varada1110
Copy link
Contributor Author

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Feb 13, 2023
@openjdk
Copy link

openjdk bot commented Feb 13, 2023

@varada1110
Your change (at version 32614a2) is now ready to be sponsored by a Committer.

@tstuefe
Copy link
Member

tstuefe commented Feb 13, 2023

/sponsor

@openjdk
Copy link

openjdk bot commented Feb 13, 2023

Going to push as commit cb81073.
Since your change was applied there have been 215 commits pushed to the master branch:

  • bbd8ae7: 8294194: [AArch64] Create intrinsics compress and expand
  • 4e327db: 8301499: Replace NULL with nullptr in cpu/zero
  • 0458d38: 6513512: MetalLookAndFeel.initClassDefaults does not install an entry for MetalMenuBarUI
  • f4b140b: 8296410: HttpClient throws java.io.IOException: no statuscode in response for HTTP2
  • 5d39d14: 8299970: Speed up compiler/arraycopy/TestArrayCopyConjoint.java
  • d1c87a0: 8302203: IR framework should detect non-compilable test methods early
  • 1fec6b5: 8301852: RISC-V: Optimize class atomic when order is memory_order_relaxed
  • 7c233bc: 8302114: RISC-V: Several foreign jtreg tests fail with debug build after JDK-8301818
  • 8049e59: 8301833: Add wide-ranging tests for FDLIBM porting
  • 6a44120: 8301269: Update Commons BCEL to Version 6.7.0
  • ... and 205 more: https://git.openjdk.org/jdk/compare/c672ed16f363d9c92ccefe2e64a96e0a60a49588...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Feb 13, 2023
@openjdk openjdk bot closed this Feb 13, 2023
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review sponsor Pull request is ready to be sponsored labels Feb 13, 2023
@openjdk
Copy link

openjdk bot commented Feb 13, 2023

@tstuefe @varada1110 Pushed as commit cb81073.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@varada1110 varada1110 deleted the createvm_call_aix branch March 27, 2025 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core-libs core-libs-dev@openjdk.org hotspot-runtime hotspot-runtime-dev@openjdk.org integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

5 participants