Skip to content

8347830: [premain] UseCompatibleCompressedOops is broken after merging with mainline #67

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

Open
wants to merge 2 commits into
base: premain
Choose a base branch
from

Conversation

vnkozlov
Copy link
Collaborator

@vnkozlov vnkozlov commented May 16, 2025

The issue was that we did not allocate space "noaccess prefix" before heap for read-only page when we setup type of encoding with UseCompatibleCompressedOops flag. I update code which reserves heap for compressed oops to take into account this flag.

An other issue was that UseCompatibleCompressedOops flag was set during CDS arguments consistency checkup. But UseCompressedOops flag is set by GC ergonomics. I moved code to CDS ergonomics setting method.

During testing I hit assert that AOT code address table is missing some code blob address. But it was actually card table base address which pointed inside CodeCache. I added special case to check for it early.

Tested premain-tier1.


Progress

  • Change must not contain extraneous whitespace
  • Change must be properly reviewed (1 review required, with at least 1 Committer)

Issue

  • JDK-8347830: [premain] UseCompatibleCompressedOops is broken after merging with mainline (Bug - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 67

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/leyden/pull/67.diff

Using Webrev

Link to Webrev Comment

@vnkozlov
Copy link
Collaborator Author

@ashu-mehra and @adinn please look.

@bridgekeeper
Copy link

bridgekeeper bot commented May 16, 2025

👋 Welcome back kvn! A progress list of the required criteria for merging this PR into premain 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 May 16, 2025

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

8347830: [premain] UseCompatibleCompressedOops is broken after merging with mainline

Reviewed-by: asmehra

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 no new commits pushed to the premain branch. If another commit should be pushed before you perform the /integrate command, your PR will be automatically rebased. If you prefer to avoid any potential automatic rebasing, please check the documentation for the /integrate command for further details.

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

@openjdk openjdk bot added the rfr Pull request is ready for review label May 16, 2025
@mlbridge
Copy link

mlbridge bot commented May 16, 2025

Webrevs

if (UseCompressedOops && AOTCodeCache::is_caching_enabled()) {
FLAG_SET_ERGO_IF_DEFAULT(UseCompatibleCompressedOops, true);
} else if (!FLAG_IS_DEFAULT(UseCompatibleCompressedOops)) {
FLAG_SET_ERGO(UseCompatibleCompressedOops, false);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do we need to set it to false explicitly here? If it is not default shouldn't we use whatever value the user specified?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I consider the flag make sense only for AOT code and not for general usage. See description: globals.hpp#L132

We don't want generate more complex encoding if we don't generate/use AOT code. Or compressed oops are off.
We had also recently discussed how we should disable some AOT features if AOT caching is off - the conclusion was that we should silently ignore them (may be produce UL output on demand). That is why I used ERGO setting.

Copy link
Collaborator

Choose a reason for hiding this comment

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

okay


bool unscaled = false;
bool zerobased = false;
bool heapbased = UseCompatibleCompressedOops;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Use of heapbased is a bit confusing to me. Can we restructure it like this:

bool unscaled = false;
bool zerobased = false;
if (UseCompatibleCompressedOops) {
  unscaled = (heap_end_address <= (char*)UnscaledOopHeapMax);
  zerobased = (heap_end_address <= (char*)OopEncodingHeapMax);
}
size_t noaccess_prefix = (UseCompatibleCompressedOops || !zerobased) ? noaccess_prefix_size : 0;

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I can do that. I got names from CompressedOops::Mode values

@vnkozlov
Copy link
Collaborator Author

@ashu-mehra I refactored code as you asked.

@vnkozlov
Copy link
Collaborator Author

@ashu-mehra I refactored code as you asked.

I looked on our old code where we added this flag and found that I missed 2 other places to check which I added now.

Copy link
Collaborator

@ashu-mehra ashu-mehra 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

@openjdk openjdk bot added the ready Pull request is ready to be integrated label May 16, 2025
@vnkozlov
Copy link
Collaborator Author

Thank you. @ashu-mehra

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready Pull request is ready to be integrated rfr Pull request is ready for review
Development

Successfully merging this pull request may close these issues.

2 participants