> On Mar 9, 2020, at 4:30 AM, Magnus Ihse Bursie <[email protected]> wrote:
> 
> When reworking the JVM feature handling, I wanted to try to compile Hotspot 
> with various features enabled/disabled. I quickly found out that it's not 
> really possible to build hotspot without the serial gc. While this is not a 
> terribly important use case, I think it's good to be able to select serial 
> freely, just as with the other collectors.
> 
> With this patch it is possible to build a truly minimal JVM using 'configure 
> --with-jvm-variants=custom --with-jvm-features=g1gc'.
> 
> Bug: https://bugs.openjdk.java.net/browse/JDK-8240224
> WebRev: 
> http://cr.openjdk.java.net/~ihse/JDK-8240224-building-without-serial-gc/webrev.01
> 
> /Magnus

I'm inclined to agree with David and Aleksey that this isn't really a
worthwhile exercise. Especially not if it involves making some
otherwise questionable or controversial changes.

In addition to the issues mentioned by David and Aleksey:

------------------------------------------------------------------------------
src/hotspot/share/gc/shared/gcConfig.cpp

I would instead suggest there should not be a default at all instead
of adding these cases, and the user must explicitly select the GC to
be used. Since we're talking about an atypical custom build anyway,
the user presumably knows what they are doing. And yeah, that makes
the buildjdk stuff elsewhere in this patch harder.

Really, I think this ought to just be left alone, along with most of
the other build-specific changes.

[This also responds to / agrees with Aleksey's comment about this part.]

------------------------------------------------------------------------------
src/hotspot/share/gc/shared/genCollectedHeap.cpp
 197 #if INCLUDE_SERIALGC
 198   MarkSweep::initialize();
 199 #endif

This whole file, and several associated files, are *only* used by
SerialGC now that CMS has been removed: JDK-8234502.

------------------------------------------------------------------------------
make/hotspot/lib/JvmFeatures.gmk 
  58 ifeq ($(JVM_VARIANT), custom)
  59   JVM_CFLAGS_FEATURES += -DVMTYPE=\"Custom\"
  60 endif

This change looks unrelated to whether serialgc is present or absent.
If so, it doesn't belong in this changeset at all.

------------------------------------------------------------------------------
make/hotspot/lib/JvmFeatures.gmk 
[removed]
 154   # If serial is disabled, we cannot use serial as OldGC in parallel
 155   JVM_EXCLUDE_FILES += psMarkSweep.cpp psMarkSweepDecorator.cpp

This was missed by JDK-8235860, which removed those files.  Good find.

------------------------------------------------------------------------------
test/hotspot/gtest/gc/shared/test_collectorPolicy.cpp

As originally written, this test was *only* testing SerialGC. It's not
obvious that it is actually GC-agnostic and can use the default GC if
that isn't SerialGC.  Certainly some of the naming suggests otherwise.
Was this tested with all the other configurations?

------------------------------------------------------------------------------

Reply via email to