jdk icon indicating copy to clipboard operation
jdk copied to clipboard

8282729: Serial: Move BOT implementation to collector specific directory

Open xmas92 opened this issue 3 years ago • 7 comments
trafficstars

Moves serial code from share/gc/shared/blockOffsetTable.* to share/gc/serial/serialBlockOffsetTable.* Move required fixing up some missing header files. Refactoring tries to respect INCLUDE_SERIALGC without changing any behaviour.

Given that --disable-jvm-feature-serialgc will not build before this change, it will not build afterwards either. However it does now compile, but will fail to link.

The diff below is enough to for make hotspot to run (on macosx-aarch64), but it will not build the complete JDK as the build system will use the compiled binaries with -XX:+UseSerialGC which obviously won't work as that GC is missing.

diff --git a/src/hotspot/share/gc/shared/genCollectedHeap.cpp b/src/hotspot/share/gc/shared/genCollectedHeap.cpp
index 5558f1a4a32..79b465b3e0a 100644
--- a/src/hotspot/share/gc/shared/genCollectedHeap.cpp
+++ b/src/hotspot/share/gc/shared/genCollectedHeap.cpp
@@ -31,7 +31,6 @@
 #include "code/icBuffer.hpp"
 #include "compiler/oopMap.hpp"
 #include "gc/serial/defNewGeneration.hpp"
-#include "gc/serial/markSweep.hpp"
 #include "gc/shared/adaptiveSizePolicy.hpp"
 #include "gc/shared/cardTableBarrierSet.hpp"
 #include "gc/shared/cardTableRS.hpp"
@@ -80,6 +79,9 @@
 #if INCLUDE_JVMCI
 #include "jvmci/jvmci.hpp"
 #endif
+#if INCLUDE_SERIALGC
+#include "gc/serial/markSweep.hpp"
+#endif
 
 GenCollectedHeap::GenCollectedHeap(Generation::Name young,
                                    Generation::Name old,
@@ -204,9 +206,9 @@ void GenCollectedHeap::post_initialize() {
   initialize_size_policy(def_new_gen->eden()->capacity(),
                          _old_gen->capacity(),
                          def_new_gen->from()->capacity());
-
+#if INCLUDE_SERIALGC
   MarkSweep::initialize();
-
+#endif
   ScavengableNMethods::initialize(&_is_scavengable);
 }
 
diff --git a/test/hotspot/gtest/gc/shared/test_collectorPolicy.cpp b/test/hotspot/gtest/gc/shared/test_collect
orPolicy.cpp
index dfe096248c7..30a24fd9232 100644
--- a/test/hotspot/gtest/gc/shared/test_collectorPolicy.cpp
+++ b/test/hotspot/gtest/gc/shared/test_collectorPolicy.cpp
@@ -31,6 +31,7 @@
 #include "utilities/macros.hpp"
 #include "unittest.hpp"
 
+#if INCLUDE_SERIALGC
 class TestGenCollectorPolicy {
  public:
 
@@ -279,3 +280,4 @@ TEST_OTHER_VM(CollectorPolicy, old_cmd) {
 
   TestGenCollectorPolicy::TestWrapper::test(&setter_old_size, &setter_max_new_size, &checker_large);
 }
+#endif

There is still a lot of Serial only code in the shared code base. The share/gc/shared/space.* is a clear next candidate for refactoring as this change required a bunch of code in there to depend on INCLUDE_SERIALGC to build.

Testing: Tier 1


Progress

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

Issue

  • JDK-8282729: Serial: Move BOT implementation to collector specific directory

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 9662

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

Using diff file

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

xmas92 avatar Jul 27 '22 18:07 xmas92

:wave: Welcome back xmas92! 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.

bridgekeeper[bot] avatar Jul 27 '22 18:07 bridgekeeper[bot]

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

  • hotspot-gc

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[bot] avatar Jul 27 '22 18:07 openjdk[bot]

Webrevs

mlbridge[bot] avatar Jul 27 '22 18:07 mlbridge[bot]

Passed: tier 2-5 java/lang/ProcessBuilder/PipelineLeaksFD.java failed in tier 1. But it succeeded in the previous run (same source) and succeeded when I reran tier 1. Given that the test is working with os pipes it seems unrelated to this PR.

xmas92 avatar Jul 29 '22 07:07 xmas92

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

8282729: Serial: Move BOT implementation to collector specific directory

Reviewed-by: tschatzl, ayang

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

  • 486f90c134f3b8562221839f8a3aefa74ae0d070: 8292716: Configure should check that jtreg is of the required version
  • b4e1aa87e3caa56bde52120bb3d84da53e7ebaa3: 8289658: Avoid redundant LinkedHashMap.get call in TagletManager.addNewSimpleCustomTag
  • 84936e9278100fc641a9c6df3cc5fc18c0386c32: 8292586: simplify cleanups in NTLMAuthSequence getCredentialsHandle
  • 259ba86c60c9f17ac7302f73cd1e3532474c9f18: 8290075: [JVMCI] only blessed methods can link against EventWriterFactory.getEventWriter
  • a85a72341bd840b2c7b66ce32c8bbca920e519c8: 8292351: tty should always live
  • 4da1745836550224306ca66201c35a5baaf30953: 8291118: [vectorapi] Optimize the implementation of lanewise FIRST_NONZERO
  • 38a81913d33c856d64b7c26f934026815a482e43: 8290322: Optimize Vector.rearrange over byte vectors for AVX512BW targets.
  • 27af0144ea57e86d9b81c2b328fad66e4a046f61: 8292743: Missing include resourceHash.hpp
  • f58aaab4a40f09be03d77a8df8dfefa94e47b320: 8292262: adjust timeouts in several M&M tests
  • ab6988599cded028ebfc4c958bc9e88d1b365ad7: 8292215: java/util/stream/boottest/java.base/java/util/stream/SpinedBufferTest.java times out with slowdebug
  • ... and 38 more: https://git.openjdk.org/jdk/compare/f2f0cd86bf4dce4633f484476077fd090549780e...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 (@tschatzl, @albertnetymk) 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[bot] avatar Jul 29 '22 15:07 openjdk[bot]

It's a bit surprising to see changes to other collectors in a commit titled "Serial: ...". I guess that's what you meant by "Move required fixing up some missing header files." I wonder if you can extract those fixes in another PR(s), which, IMO, would also make reviewing this PR slightly easier. Basically keeping each PR more focused.

albertnetymk avatar Aug 15 '22 12:08 albertnetymk

It's a bit surprising to see changes to other collectors in a commit titled "Serial: ...". I guess that's what you meant by "Move required fixing up some missing header files." I wonder if you can extract those fixes in another PR(s), which, IMO, would also make reviewing this PR slightly easier. Basically keeping each PR more focused.

It seems a bit ugly to leave the repository in an intermediate state where some headers are included only because there is something, somewhere else, that need that include. But if it makes the review easier I'll move

-#include "gc/shared/gc_globals.hpp"
-#include "memory/virtualspace.hpp"

into a different issue, so G1 and Epsilons still have all their required (indirect) includes.

xmas92 avatar Aug 15 '22 13:08 xmas92

I agree, used that name because of the All source files must have a globally unique basename. The build system depends on this uniqueness. rule. But it will be cleaner if the BlockOffsetTable.hpp still in shared would be named something like BOTConstants.hpp or BlockOffsetTableConstants.hpp. However that change would change the header includes in a lot of files, but as it is only a rename maybe it is ok? From a review perspecive.

Regardless want to integrate #9921 / JDK-8292606 before this so the header files in whatever shared/BlockOffsetTable.hpp will be called can be cleaned up.

xmas92 avatar Aug 18 '22 15:08 xmas92

/integrate

xmas92 avatar Aug 23 '22 08:08 xmas92

@xmas92 Your change (at version a31fb7fc3ea2d2dcad490b21fbdf304e30cad260) is now ready to be sponsored by a Committer.

openjdk[bot] avatar Aug 23 '22 08:08 openjdk[bot]

/sponsor

albertnetymk avatar Aug 24 '22 09:08 albertnetymk

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

  • fa5cc4cc8e1c7c1f627905191e311cfcb3d94b5e: 8291878: NMT: Malloc limits
  • ad2e0c4df045261c04b00bfa1faf5c21392edc58: 8292778: EncodingSupport_md.c convertUtf8ToPlatformString wrong placing of free
  • 13c03696463cb3ba77663edfd2dfb78d3f45cbaa: 8242181: [Linux] Show source information when printing native stack traces in hs_err files
  • fe0544f8a7db5bf0e93313e16b54b31bcdff946a: 8292790: Remove hashtable.hpp from other files
  • 926380d3b748fd591f45abc99c497abc62c52565: 8292640: C2: Remove unused scratch register usages on x86
  • f3be6731d3fa4fb1b7fc42c5bcbe6a64a50eaf42: 8292638: x86: Improve scratch register handling in VM stubs
  • d24b7b7026cf85f1aecf44f60819762872cfd5c1: 8276651: java/lang/ProcessHandle tests fail with "RuntimeException: Input/output error" in java.lang.ProcessHandleImpl$Info.info0
  • 8a45abd5f3bb224e564c8e6087bac618147f484e: 8292654: G1 remembered set memory footprint regression after JDK-8286115
  • cc287832c2f5e58a37468952fdcdb8c326d07118: 8292777: Remove hashtable.hpp from dependencies.hpp
  • cf0067741249cc3260b1d220769dac408b614f22: 8292368: [ppc64] internal error g1BarrierSet.inline.hpp assert(oopDesc::is_oop(pre_val, true)) failed: Error
  • ... and 49 more: https://git.openjdk.org/jdk/compare/f2f0cd86bf4dce4633f484476077fd090549780e...master

Your commit was automatically rebased without conflicts.

openjdk[bot] avatar Aug 24 '22 09:08 openjdk[bot]

@albertnetymk @xmas92 Pushed as commit 0813a4705184e33f6bd175dcd9a17d3212890daf.

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

openjdk[bot] avatar Aug 24 '22 09:08 openjdk[bot]