Skip to content

Conversation

@iklam
Copy link
Member

@iklam iklam commented May 17, 2021

SystemDictionaryShared::should_be_excluded is called during CDS dump time to see if a class should be excluded from the archive. This function calls itself to check super types. As a result, some classes many be checked more than once.

The repeated calls slows down dumping. Also, If a class is excluded, we will see multiple warning messages like this, which is too verbose and confusing.

Skipping org/eclipse/osgi/util/NLS: Signed JAR
Skipping org/eclipse/osgi/util/NLS: Signed JAR
Skipping org/eclipse/osgi/util/NLS: Signed JAR

BTW, to make the code a little easier to read, I also changed

 warn_excluded(k, "Failed verification");
 return true;

to

return  warn_excluded(k, "Failed verification");

Progress

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

Issue

  • JDK-8267191: Avoid repeated SystemDictionaryShared::should_be_excluded calls

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 4070

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented May 17, 2021

👋 Welcome back iklam! 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 May 17, 2021

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

  • hotspot-runtime

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-runtime hotspot-runtime-dev@openjdk.org label May 17, 2021
@iklam iklam marked this pull request as ready for review May 17, 2021 17:51
@openjdk openjdk bot added the rfr Pull request is ready for review label May 17, 2021
@mlbridge
Copy link

mlbridge bot commented May 17, 2021

Webrevs

@iklam iklam changed the title 8267191 avoid repeated should be excluded 8267191: Avoid repeated SystemDictionaryShared::should_be_excluded calls May 17, 2021
@mlbridge
Copy link

mlbridge bot commented May 17, 2021

Mailing list message from Ioi Lam on hotspot-runtime-dev:

Correcting the title of the PR:

JDK-8267191: Avoid repeated SystemDictionaryShared::should_be_excluded calls

On 5/17/21 10:55 AM, Ioi Lam wrote:

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.

Hi Ioi,

These changes seem fine.

A couple of nits below.

Thanks,
David

if (k->is_hidden() && !is_registered_lambda_proxy_class(k)) {
ResourceMark rm;
log_warning(cds)("Skipping %s: super class %s is excluded", k->name()->as_C_string(), super->name()->as_C_string());
log_debug(cds)("Skipping %s: %s", k->name()->as_C_string(), "Hidden class");
Copy link
Member

Choose a reason for hiding this comment

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

You don't need to feed "Hidden class" to a %s.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed.

if (super != NULL && check_for_exclusion(super, NULL)) {
ResourceMark rm;
log_debug(cds)("Skipping %s: %s", k->name()->as_C_string(), "Hidden class");
log_warning(cds)("Skipping %s: super class %s is excluded @%p", k->name()->as_C_string(), super->name()->as_C_string(), super);
Copy link
Member

Choose a reason for hiding this comment

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

Pretty sure we still don't/can't use %p in shared code, but should be INTPTR_FORMAT and use p2i(super)

Copy link
Member Author

Choose a reason for hiding this comment

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

I reverted back to the original code and removed the %p. I added %p for temporary debugging only.

if (should_be_excluded(intf)) {
log_warning(cds)("Skipping %s: interface %s is excluded", k->name()->as_C_string(), intf->name()->as_C_string());
if (check_for_exclusion(intf, NULL)) {
log_warning(cds)("Skipping %s: interface %s is excluded @%p", k->name()->as_C_string(), intf->name()->as_C_string(), intf);
Copy link
Member

Choose a reason for hiding this comment

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

Ditto on %p

@openjdk
Copy link

openjdk bot commented May 18, 2021

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

8267191: Avoid repeated SystemDictionaryShared::should_be_excluded calls

Reviewed-by: dholmes, coleenp

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 master 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 master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label May 18, 2021
Copy link
Contributor

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

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.

LGTM.

@iklam
Copy link
Member Author

iklam commented May 19, 2021

Thanks @coleenp and @dholmes-ora for the review!
/integrate

@openjdk openjdk bot closed this May 19, 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 May 19, 2021
@openjdk
Copy link

openjdk bot commented May 19, 2021

@iklam Since your change was applied there have been 26 commits pushed to the master branch:

Your commit was automatically rebased without conflicts.

Pushed as commit b961f25.

💡 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-runtime hotspot-runtime-dev@openjdk.org integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

3 participants