Skip to content

Conversation

@TobiHartmann
Copy link
Member

@TobiHartmann TobiHartmann commented Nov 22, 2021

In the rare case that the compiler threads fail during initialization or the code cache is full and flushing is disabled, we completely disable JIT compilation and shut down the compiler runtime:

if (comp->should_perform_shutdown()) {
// There are two reasons for shutting down the compiler
// 1) compiler runtime initialization failed
// 2) The code cache is full and the following flag is set: -XX:-UseCodeCacheFlushing
warning("%s initialization failed. Shutting down all compilers", comp->name());

In the process, we free all compiler queues and set CompileQueue::_first to NULL and put the CompileTasks on the free list:

task->set_next(_task_free_list);

In rare cases, although compilation is disabled, another waiting thread might still call CompileQueue::add. That code then fails because _last != NULL and _last->next() is set to _task_free_list.

if (_last == NULL) {
// The compile queue is empty.
assert(_first == NULL, "queue is empty");
_first = task;
_last = task;
} else {
// Append the task to the queue.
assert(_last->next() == NULL, "not last");

The fix is to set _last to NULL in CompileQueue::free_all. Adding to the compile queue then succeeds which is harmless because queues have only been freed to make the compiler threads exit faster:

// Delete all queued compilation tasks to make compiler threads exit faster.

The test that triggered this will be added with PR 6364. I verified that it now passes.

Thanks,
Tobias


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8277441: CompileQueue::add fails with assert(_last->next() == __null) failed: not last

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/6503/head:pull/6503
$ git checkout pull/6503

Update a local copy of the PR:
$ git checkout pull/6503
$ git pull https://git.openjdk.java.net/jdk pull/6503/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 6503

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/6503.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Nov 22, 2021

👋 Welcome back thartmann! 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 openjdk bot added the rfr Pull request is ready for review label Nov 22, 2021
@openjdk
Copy link

openjdk bot commented Nov 22, 2021

@TobiHartmann The following label will be automatically applied to this pull request:

  • hotspot-compiler

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

@openjdk openjdk bot added the hotspot-compiler hotspot-compiler-dev@openjdk.org label Nov 22, 2021
@mlbridge
Copy link

mlbridge bot commented Nov 22, 2021

Webrevs

Copy link
Member

@chhagedorn chhagedorn 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!

@openjdk
Copy link

openjdk bot commented Nov 22, 2021

@TobiHartmann 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:

8277441: CompileQueue::add fails with assert(_last->next() == __null) failed: not last

Reviewed-by: chagedorn, neliasso

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 3 new commits pushed to the master branch:

  • e529865: 8277239: SIGSEGV in vrshift_reg_maskedNode::emit
  • 8683de5: 8274685: Documentation suggests there are ArbitrarilyJumpableGenerator when none
  • 6b4fbae: 8273792: JumpableGenerator.rngs() documentation refers to wrong method

Please see this link for an up-to-date comparison between the source branch of this pull request and the master branch.
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.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Nov 22, 2021
@TobiHartmann
Copy link
Member Author

Thanks for the review, Christian!

Copy link

@neliasso neliasso 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!

@TobiHartmann
Copy link
Member Author

Thanks for the review, Nils!

@TobiHartmann
Copy link
Member Author

/integrate

@openjdk
Copy link

openjdk bot commented Nov 23, 2021

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

  • 66eaf65: 8277413: Remove unused local variables in jdk.hotspot.agent
  • 36b887a: 8277560: Remove WorkerDataArray::_is_serial
  • 017df14: 8277556: Call ReferenceProcessorPhaseTimes::set_processing_is_mt once
  • 79350b9: 8276216: Negated character classes performance regression in Pattern
  • e3243ee: 8277087: ZipException: zip END header not found at ZipFile#Source.findEND
  • 12f08ba: 8277507: Add jlink.debug system property while launching jpackage tests to help diagonize recent intermittent failures
  • bb11c55: 8277542: G1: Move G1CardSetFreePool and related classes to separate files
  • f62b81c: 8273095: vmTestbase/vm/mlvm/anonloader/stress/oome/heap/Test.java fails with "wrong OOME"
  • 05a9a51: 8277423: ciReplay: hidden class with comment expected error
  • 1049aba: 8277576: ProblemList runtime/ErrorHandling/CreateCoredumpOnCrash.java on macosx-X64
  • ... and 8 more: https://git.openjdk.java.net/jdk/compare/d427c79d3bd6c80b67c10d15a461f13ae7e0f84b...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot closed this Nov 23, 2021
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Nov 23, 2021
@openjdk
Copy link

openjdk bot commented Nov 23, 2021

@TobiHartmann Pushed as commit 90f96fb.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hotspot-compiler hotspot-compiler-dev@openjdk.org integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

3 participants