Skip to content

8299915: Remove ArrayAllocatorMallocLimit and associated code #15859

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 4 commits into from

Conversation

afshin-zafari
Copy link
Contributor

@afshin-zafari afshin-zafari commented Sep 21, 2023

  1. ArrayAllocatorMallocLimit is removed. The test cases that tested it also are removed.
  2. AllocArrayAllocator instances are replaced with MallocArrayAllocator.
  3. The signature of CHeapBitMap::free(ptr, size) is kept as it is, since it is called in this way from GrowableBitMap<T>::resize, where T can be also ArenaBitMap and ResourceBitMap. However, it uses MallocArrayAllocator::free(ptr) and ignores the size:
void CHeapBitMap::free(bm_word_t* map, idx_t size_in_words) const { 
 MallocArrayAllocator<bm_word_t>::free(map);
}

Test

tiers1-4 passed on all platforms.


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-8299915: Remove ArrayAllocatorMallocLimit and associated code (Enhancement - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 15859

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

Using diff file

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

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Sep 21, 2023

👋 Welcome back azafari! 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 Sep 21, 2023
@openjdk
Copy link

openjdk bot commented Sep 21, 2023

@afshin-zafari The following labels will be automatically applied to this pull request:

  • hotspot
  • serviceability

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 serviceability serviceability-dev@openjdk.org hotspot hotspot-dev@openjdk.org labels Sep 21, 2023
@mlbridge
Copy link

mlbridge bot commented Sep 21, 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.

Functional removal of code looks good, but some of the test changes need to be changed.

Thanks.

Comment on lines 60 to 64
// Test a non-manageable size_t flag.
// Since it is not manageable, we can't test the setFlag functionality.
testGetFlag("ArrayAllocatorMallocLimit", "128");
// testSetFlag("ArrayAllocatorMallocLimit", "64", "128");

Copy link
Member

Choose a reason for hiding this comment

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

You need to replace this with another non-manageable size_t flag so that code coverage is maintained.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

Copy link
Member

Choose a reason for hiding this comment

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

This test also should not be removed but changed to use a different size_t flag so that the WB functionality continues to be tested for a flag of this type.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

@@ -57,6 +57,10 @@ public static void main(String... args) throws Exception {
testGetFlag("MaxHeapFreeRatio", "60");
testSetFlag("MaxHeapFreeRatio", "50", "60");

// Test a non-manageable size_t flag.
// Since it is not manageable, we can't test the setFlag functionality.
testGetFlag("StringDeduplicationCleanupDeadMinimum", "128");
Copy link
Member

Choose a reason for hiding this comment

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

A non-experimental flag, like MetaspaceSize, might be better long term in case the experimental flag get removed again.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When MetaspaceSize is set to 0, following assertion raised at metaspace.cpp: 316

size_t MetaspaceGC::capacity_until_GC() {
  size_t value = Atomic::load_acquire(&_capacity_until_GC);
  assert(value >= MetaspaceSize, "Not initialized properly?");  // <-----
  return value;
}

LargePageSizeInBytes is used instead.

@@ -35,7 +35,7 @@
import jdk.test.lib.Platform;

public class SizeTTest {
private static final String FLAG_NAME = "ArrayAllocatorMallocLimit";
private static final String FLAG_NAME = "StringDeduplicationCleanupDeadMinimum";
Copy link
Member

Choose a reason for hiding this comment

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

Again a non-experimental flag, like MetaspaceSize, might be better here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

MetaspaceSize is used with its lower bound 65536. Otherwise, the test fails.

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.

Thanks for test changes. Seems fine. Thanks.

@openjdk
Copy link

openjdk bot commented Sep 26, 2023

@afshin-zafari 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:

8299915: Remove ArrayAllocatorMallocLimit and associated code

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

  • 788e6e1: 8316218: Open some swing tests 5
  • ee9776f: 8304839: Move TestScaffold.main() to the separate class DebugeeWrapper
  • 36ac839: 8073061: (fs) Files.copy(foo, bar, REPLACE_EXISTING) deletes bar even if foo is not readable
  • efb7e85: 8316935: [s390x] Use consistent naming for lightweight locking in MacroAssembler
  • 4e1e579: 8315920: C2: "control input must dominate current control" assert failure
  • 1f7dfda: 8316671: sun/security/ssl/SSLSocketImpl/SSLSocketCloseHang.java test fails intermittent with Read timed out
  • 20ff603: 8316735: Print LockStack in hs_err files
  • e510dee: 8316098: Revise signature of numa_get_leaf_groups
  • 1513e79: 8316940: Serial: Remove unused declarations in genCollectedHeap
  • 52983ed: 8303737: C2: Load can bypass subtype check that enforces it's from the right object type
  • ... and 107 more: https://git.openjdk.org/jdk/compare/fab372d3a23b17f64ae4306e28bdb0bc511f4912...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.

➡️ 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 Sep 26, 2023
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.

This looks good to me.

@afshin-zafari
Copy link
Contributor Author

Thank you @coleenp and @dholmes-ora for your reviews.
/integrate

@openjdk
Copy link

openjdk bot commented Sep 27, 2023

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

  • 50a7a04: 8316417: ObjectMonitorIterator does not return the most recent monitor and is incorrect if no monitors exists
  • fee9d33: 8293176: SSLEngine handshaker does not send an alert after a bad parameters
  • fd52be2: 8316895: SeenThread::print_action_queue called on a null pointer
  • e39197e: 8316933: RISC-V: compiler/vectorapi/VectorCastShape128Test.java fails when using RVV
  • b659e03: 8316897: tools/jpackage/junit tests fail on AIX after JDK-8316547
  • 83806ab: 6450193: After the first Serialization, JTableHeader does not uninstall its UI
  • 2f311d5: 8316211: Open source several manual applet tests
  • 65227a3: 8316389: Open source few AWT applet tests
  • 788e6e1: 8316218: Open some swing tests 5
  • ee9776f: 8304839: Move TestScaffold.main() to the separate class DebugeeWrapper
  • ... and 115 more: https://git.openjdk.org/jdk/compare/fab372d3a23b17f64ae4306e28bdb0bc511f4912...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Sep 27, 2023

@afshin-zafari Pushed as commit 45a145e.

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

Successfully merging this pull request may close these issues.

3 participants