RFR [XXS]: 8237382: Cleanup the OPT_SPEED_SRC file list in JvmFeatures.gmk
Hello, please review this very small change . It removes file that are not present any more from the OPT_SPEED_SRC file list in JvmFeatures.gmk . ( this is a list of files to be optimized for speed when we otherwise optimize for size in the minimal-JVM build) Bug/webrev : https://bugs.openjdk.java.net/browse/JDK-8237382 http://cr.openjdk.java.net/~mbaesken/webrevs/8237382.0/ Thanks, Matthias
Re: configuring with --with-jvm-variants=minimal,server makes cds disappear in server
On 2020-01-16 10:48, Ioi Lam wrote: On 1/16/20 9:09 AM, Erik Joelsson wrote: I would lean towards changing the check from "if any of the variants do not support CDS, disable it" to "if any of the variants support CDS, enable it". The cds jvm feature is only added to the variants that support it anyway. If you do this, you probably need to figure out how to explicitly only generate the archive for the supported jvm variants in Images.gmk too. Not sure if the archive is jvm variant dependent or if the layout even supports multiple variants. It will likely get messy. The CDS archive is dependent on the exact libjvm.so, so each JDK image should creates its own CDS archive during the build. I think this can be handled emitting a different value for "BUILD_CDS_ARCHIVE" in the spec.gmk of each variant. Building with multiple JVM variants does not create separate JDK images, the libjvm.so files simply end up in: lib/server/libjvm.so lib/minimal/libjvm.so I don't think the default archive takes that into account. /Erik Thanks - Ioi /Erik On 2020-01-16 08:22, Baesken, Matthias wrote: Hello, thanks for looking into it . Should I do a check just looking into single JVM configs, something like AC_DEFUN([HOTSPOT_IS_JVM_VARIANT], [ [ [[ " $JVM_VARIANTS " == " $1 " ]] ] ]) if HOTSPOT_IS_JVM_VARIANT(zero) || HOTSPOT_IS_JVM_VARIANT(minimal) || HOTSPOT_IS_JVM_VARIANT(core); then instead of AC_DEFUN([HOTSPOT_CHECK_JVM_VARIANT], [ [ [[ " $JVM_VARIANTS " =~ " $1 " ]] ] ]) if HOTSPOT_CHECK_JVM_VARIANT(zero) || HOTSPOT_CHECK_JVM_VARIANT(minimal) || HOTSPOT_CHECK_JVM_VARIANT(core); then This should remove the error in case of multi-JVM configs . Or maybe the whole check ( if HOTSPOT_CHECK_JVM_VARIANT(zero) || HOTSPOT_CHECK_JVM_VARIANT(minimal) || HOTSPOT_CHECK_JVM_VARIANT(core); then fi ) might be removed , I see not so much value in it because in case one sets --enable-jvm-features directly the check isn’t done . I opened bug : https://bugs.openjdk.java.net/browse/JDK-8237374 JDK-8237374 : configuring with --with-jvm-variants=minimal,server makes cds disappear in server Best regards, Matthias This does indeed look like a bug to me. At least at Oracle, we no longer build any multi JVM configs regularly, so things like this falls through the cracks. /Erik On 2020-01-16 02:18, Baesken, Matthias wrote: Hello, I noticed the following strange "feature" (or is it a bug?) . When building 2 VM variants in one build and using --with-jvm-variants=minimal,server For this, the build works nicely. But I notice that in the server VM, cds is removed. Instead of checking if cds should be enabled... yes I get ( with the following patch that adds tracing) : configure: WARNING: ENABLE_CDS set to false because we found a minimal, core or zero JVM. checking if cds should be enabled... no ... * JVM features: minimal: 'compiler1 minimal serialgc' server: 'compiler1 compiler2 epsilongc g1gc jfr jni-check jvmti management nmt parallelgc serialgc services vm-structs' (patch is --- a/make/autoconf/hotspot.m4 Wed Jan 15 21:20:40 2020 -0800 +++ b/make/autoconf/hotspot.m4 Thu Jan 16 10:24:43 2020 +0100 @@ -528,6 +528,7 @@ if HOTSPOT_CHECK_JVM_VARIANT(zero) || HOTSPOT_CHECK_JVM_VARIANT(minimal) || HOTSPOT_CHECK_JVM_VARIANT(core); then # ..except when the user explicitely requested it with --enable-jvm- features if ! HOTSPOT_CHECK_JVM_FEATURE(cds); then ENABLE_CDS="false" + AC_MSG_WARN([ENABLE_CDS set to false because we found a minimal, core or zero JVM.]) if test "x$enable_cds" = "xyes"; then AC_MSG_ERROR([CDS not implemented for variants zero, minimal, core. Remove --enable-cds.]) Fi Is it expected that cds goes away in "server" when configuring "--with- jvm-variants=minimal,server" ? Looks like a bug to me, should it be fixed (so that cds stays in the server jvm-feature list) ? Thanks, Matthias
Re: configuring with --with-jvm-variants=minimal,server makes cds disappear in server
On 1/16/20 9:09 AM, Erik Joelsson wrote: I would lean towards changing the check from "if any of the variants do not support CDS, disable it" to "if any of the variants support CDS, enable it". The cds jvm feature is only added to the variants that support it anyway. If you do this, you probably need to figure out how to explicitly only generate the archive for the supported jvm variants in Images.gmk too. Not sure if the archive is jvm variant dependent or if the layout even supports multiple variants. It will likely get messy. The CDS archive is dependent on the exact libjvm.so, so each JDK image should creates its own CDS archive during the build. I think this can be handled emitting a different value for "BUILD_CDS_ARCHIVE" in the spec.gmk of each variant. Thanks - Ioi /Erik On 2020-01-16 08:22, Baesken, Matthias wrote: Hello, thanks for looking into it . Should I do a check just looking into single JVM configs, something like AC_DEFUN([HOTSPOT_IS_JVM_VARIANT], [ [ [[ " $JVM_VARIANTS " == " $1 " ]] ] ]) if HOTSPOT_IS_JVM_VARIANT(zero) || HOTSPOT_IS_JVM_VARIANT(minimal) || HOTSPOT_IS_JVM_VARIANT(core); then instead of AC_DEFUN([HOTSPOT_CHECK_JVM_VARIANT], [ [ [[ " $JVM_VARIANTS " =~ " $1 " ]] ] ]) if HOTSPOT_CHECK_JVM_VARIANT(zero) || HOTSPOT_CHECK_JVM_VARIANT(minimal) || HOTSPOT_CHECK_JVM_VARIANT(core); then This should remove the error in case of multi-JVM configs . Or maybe the whole check ( if HOTSPOT_CHECK_JVM_VARIANT(zero) || HOTSPOT_CHECK_JVM_VARIANT(minimal) || HOTSPOT_CHECK_JVM_VARIANT(core); then fi ) might be removed , I see not so much value in it because in case one sets --enable-jvm-features directly the check isn’t done . I opened bug : https://bugs.openjdk.java.net/browse/JDK-8237374 JDK-8237374 : configuring with --with-jvm-variants=minimal,server makes cds disappear in server Best regards, Matthias This does indeed look like a bug to me. At least at Oracle, we no longer build any multi JVM configs regularly, so things like this falls through the cracks. /Erik On 2020-01-16 02:18, Baesken, Matthias wrote: Hello, I noticed the following strange "feature" (or is it a bug?) . When building 2 VM variants in one build and using --with-jvm-variants=minimal,server For this, the build works nicely. But I notice that in the server VM, cds is removed. Instead of checking if cds should be enabled... yes I get ( with the following patch that adds tracing) : configure: WARNING: ENABLE_CDS set to false because we found a minimal, core or zero JVM. checking if cds should be enabled... no ... * JVM features: minimal: 'compiler1 minimal serialgc' server: 'compiler1 compiler2 epsilongc g1gc jfr jni-check jvmti management nmt parallelgc serialgc services vm-structs' (patch is --- a/make/autoconf/hotspot.m4 Wed Jan 15 21:20:40 2020 -0800 +++ b/make/autoconf/hotspot.m4 Thu Jan 16 10:24:43 2020 +0100 @@ -528,6 +528,7 @@ if HOTSPOT_CHECK_JVM_VARIANT(zero) || HOTSPOT_CHECK_JVM_VARIANT(minimal) || HOTSPOT_CHECK_JVM_VARIANT(core); then # ..except when the user explicitely requested it with --enable-jvm- features if ! HOTSPOT_CHECK_JVM_FEATURE(cds); then ENABLE_CDS="false" + AC_MSG_WARN([ENABLE_CDS set to false because we found a minimal, core or zero JVM.]) if test "x$enable_cds" = "xyes"; then AC_MSG_ERROR([CDS not implemented for variants zero, minimal, core. Remove --enable-cds.]) Fi Is it expected that cds goes away in "server" when configuring "--with- jvm-variants=minimal,server" ? Looks like a bug to me, should it be fixed (so that cds stays in the server jvm-feature list) ? Thanks, Matthias
Re: configuring with --with-jvm-variants=minimal,server makes cds disappear in server
I would lean towards changing the check from "if any of the variants do not support CDS, disable it" to "if any of the variants support CDS, enable it". The cds jvm feature is only added to the variants that support it anyway. If you do this, you probably need to figure out how to explicitly only generate the archive for the supported jvm variants in Images.gmk too. Not sure if the archive is jvm variant dependent or if the layout even supports multiple variants. It will likely get messy. /Erik On 2020-01-16 08:22, Baesken, Matthias wrote: Hello, thanks for looking into it . Should I do a check just looking into single JVM configs, something like AC_DEFUN([HOTSPOT_IS_JVM_VARIANT], [ [ [[ " $JVM_VARIANTS " == " $1 " ]] ] ]) if HOTSPOT_IS_JVM_VARIANT(zero) || HOTSPOT_IS_JVM_VARIANT(minimal) || HOTSPOT_IS_JVM_VARIANT(core); then instead of AC_DEFUN([HOTSPOT_CHECK_JVM_VARIANT], [ [ [[ " $JVM_VARIANTS " =~ " $1 " ]] ] ]) if HOTSPOT_CHECK_JVM_VARIANT(zero) || HOTSPOT_CHECK_JVM_VARIANT(minimal) || HOTSPOT_CHECK_JVM_VARIANT(core); then This should remove the error in case of multi-JVM configs . Or maybe the whole check ( if HOTSPOT_CHECK_JVM_VARIANT(zero) || HOTSPOT_CHECK_JVM_VARIANT(minimal) || HOTSPOT_CHECK_JVM_VARIANT(core); then fi ) might be removed , I see not so much value in it because in case one sets --enable-jvm-features directly the check isn’t done . I opened bug : https://bugs.openjdk.java.net/browse/JDK-8237374 JDK-8237374 : configuring with --with-jvm-variants=minimal,server makes cds disappear in server Best regards, Matthias This does indeed look like a bug to me. At least at Oracle, we no longer build any multi JVM configs regularly, so things like this falls through the cracks. /Erik On 2020-01-16 02:18, Baesken, Matthias wrote: Hello, I noticed the following strange "feature" (or is it a bug?) . When building 2 VM variants in one build and using --with-jvm-variants=minimal,server For this, the build works nicely. But I notice that in the server VM, cds is removed. Instead of checking if cds should be enabled... yes I get ( with the following patch that adds tracing) : configure: WARNING: ENABLE_CDS set to false because we found a minimal, core or zero JVM. checking if cds should be enabled... no ... * JVM features: minimal: 'compiler1 minimal serialgc' server: 'compiler1 compiler2 epsilongc g1gc jfr jni-check jvmti management nmt parallelgc serialgc services vm-structs' (patch is --- a/make/autoconf/hotspot.m4 Wed Jan 15 21:20:40 2020 -0800 +++ b/make/autoconf/hotspot.m4 Thu Jan 16 10:24:43 2020 +0100 @@ -528,6 +528,7 @@ if HOTSPOT_CHECK_JVM_VARIANT(zero) || HOTSPOT_CHECK_JVM_VARIANT(minimal) || HOTSPOT_CHECK_JVM_VARIANT(core); then # ..except when the user explicitely requested it with --enable-jvm- features if ! HOTSPOT_CHECK_JVM_FEATURE(cds); then ENABLE_CDS="false" + AC_MSG_WARN([ENABLE_CDS set to false because we found a minimal, core or zero JVM.]) if test "x$enable_cds" = "xyes"; then AC_MSG_ERROR([CDS not implemented for variants zero, minimal, core. Remove --enable-cds.]) Fi Is it expected that cds goes away in "server" when configuring "--with- jvm-variants=minimal,server" ? Looks like a bug to me, should it be fixed (so that cds stays in the server jvm-feature list) ? Thanks, Matthias
RE: configuring with --with-jvm-variants=minimal,server makes cds disappear in server
Hello, thanks for looking into it . Should I do a check just looking into single JVM configs, something like AC_DEFUN([HOTSPOT_IS_JVM_VARIANT], [ [ [[ " $JVM_VARIANTS " == " $1 " ]] ] ]) if HOTSPOT_IS_JVM_VARIANT(zero) || HOTSPOT_IS_JVM_VARIANT(minimal) || HOTSPOT_IS_JVM_VARIANT(core); then instead of AC_DEFUN([HOTSPOT_CHECK_JVM_VARIANT], [ [ [[ " $JVM_VARIANTS " =~ " $1 " ]] ] ]) if HOTSPOT_CHECK_JVM_VARIANT(zero) || HOTSPOT_CHECK_JVM_VARIANT(minimal) || HOTSPOT_CHECK_JVM_VARIANT(core); then This should remove the error in case of multi-JVM configs . Or maybe the whole check ( if HOTSPOT_CHECK_JVM_VARIANT(zero) || HOTSPOT_CHECK_JVM_VARIANT(minimal) || HOTSPOT_CHECK_JVM_VARIANT(core); then fi ) might be removed , I see not so much value in it because in case one sets --enable-jvm-features directly the check isn’t done . I opened bug : https://bugs.openjdk.java.net/browse/JDK-8237374 JDK-8237374 : configuring with --with-jvm-variants=minimal,server makes cds disappear in server Best regards, Matthias > > This does indeed look like a bug to me. At least at Oracle, we no longer > build any multi JVM configs regularly, so things like this falls through > the cracks. > > /Erik > > On 2020-01-16 02:18, Baesken, Matthias wrote: > > Hello, I noticed the following strange "feature" (or is it a bug?) . > > When building 2 VM variants in one build and using > > > >--with-jvm-variants=minimal,server > > > > For this, the build works nicely. But I notice that in the server VM, cds > > is > removed. > > Instead of > > > > checking if cds should be enabled... yes > > > > I get ( with the following patch that adds tracing) : > > > > configure: WARNING: ENABLE_CDS set to false because we found a > minimal, core or zero JVM. > > checking if cds should be enabled... no > >... > > > > * JVM features: minimal: 'compiler1 minimal serialgc' server: > > 'compiler1 > compiler2 epsilongc g1gc jfr jni-check jvmti management nmt parallelgc > serialgc services vm-structs' > > > > (patch is > > > > --- a/make/autoconf/hotspot.m4 Wed Jan 15 21:20:40 2020 -0800 > > +++ b/make/autoconf/hotspot.m4 Thu Jan 16 10:24:43 2020 +0100 > > @@ -528,6 +528,7 @@ > >if HOTSPOT_CHECK_JVM_VARIANT(zero) || > HOTSPOT_CHECK_JVM_VARIANT(minimal) || > HOTSPOT_CHECK_JVM_VARIANT(core); then > > # ..except when the user explicitely requested it with --enable-jvm- > features > > if ! HOTSPOT_CHECK_JVM_FEATURE(cds); then > > ENABLE_CDS="false" > > + AC_MSG_WARN([ENABLE_CDS set to false because we found a > minimal, core or zero JVM.]) > > if test "x$enable_cds" = "xyes"; then > > AC_MSG_ERROR([CDS not implemented for variants zero, minimal, > core. Remove --enable-cds.]) > > Fi > > > > > > Is it expected that cds goes away in "server" when configuring "--with- > jvm-variants=minimal,server" ? Looks like a bug to me, should it be fixed > (so that cds stays in the server jvm-feature list) ? > > > > > > Thanks, Matthias > >
Re: configuring with --with-jvm-variants=minimal,server makes cds disappear in server
This does indeed look like a bug to me. At least at Oracle, we no longer build any multi JVM configs regularly, so things like this falls through the cracks. /Erik On 2020-01-16 02:18, Baesken, Matthias wrote: Hello, I noticed the following strange "feature" (or is it a bug?) . When building 2 VM variants in one build and using --with-jvm-variants=minimal,server For this, the build works nicely. But I notice that in the server VM, cds is removed. Instead of checking if cds should be enabled... yes I get ( with the following patch that adds tracing) : configure: WARNING: ENABLE_CDS set to false because we found a minimal, core or zero JVM. checking if cds should be enabled... no ... * JVM features: minimal: 'compiler1 minimal serialgc' server: 'compiler1 compiler2 epsilongc g1gc jfr jni-check jvmti management nmt parallelgc serialgc services vm-structs' (patch is --- a/make/autoconf/hotspot.m4 Wed Jan 15 21:20:40 2020 -0800 +++ b/make/autoconf/hotspot.m4 Thu Jan 16 10:24:43 2020 +0100 @@ -528,6 +528,7 @@ if HOTSPOT_CHECK_JVM_VARIANT(zero) || HOTSPOT_CHECK_JVM_VARIANT(minimal) || HOTSPOT_CHECK_JVM_VARIANT(core); then # ..except when the user explicitely requested it with --enable-jvm-features if ! HOTSPOT_CHECK_JVM_FEATURE(cds); then ENABLE_CDS="false" + AC_MSG_WARN([ENABLE_CDS set to false because we found a minimal, core or zero JVM.]) if test "x$enable_cds" = "xyes"; then AC_MSG_ERROR([CDS not implemented for variants zero, minimal, core. Remove --enable-cds.]) Fi Is it expected that cds goes away in "server" when configuring "--with-jvm-variants=minimal,server" ? Looks like a bug to me, should it be fixed (so that cds stays in the server jvm-feature list) ? Thanks, Matthias
configuring with --with-jvm-variants=minimal,server makes cds disappear in server
Hello, I noticed the following strange "feature" (or is it a bug?) . When building 2 VM variants in one build and using --with-jvm-variants=minimal,server For this, the build works nicely. But I notice that in the server VM, cds is removed. Instead of checking if cds should be enabled... yes I get ( with the following patch that adds tracing) : configure: WARNING: ENABLE_CDS set to false because we found a minimal, core or zero JVM. checking if cds should be enabled... no ... * JVM features: minimal: 'compiler1 minimal serialgc' server: 'compiler1 compiler2 epsilongc g1gc jfr jni-check jvmti management nmt parallelgc serialgc services vm-structs' (patch is --- a/make/autoconf/hotspot.m4 Wed Jan 15 21:20:40 2020 -0800 +++ b/make/autoconf/hotspot.m4 Thu Jan 16 10:24:43 2020 +0100 @@ -528,6 +528,7 @@ if HOTSPOT_CHECK_JVM_VARIANT(zero) || HOTSPOT_CHECK_JVM_VARIANT(minimal) || HOTSPOT_CHECK_JVM_VARIANT(core); then # ..except when the user explicitely requested it with --enable-jvm-features if ! HOTSPOT_CHECK_JVM_FEATURE(cds); then ENABLE_CDS="false" + AC_MSG_WARN([ENABLE_CDS set to false because we found a minimal, core or zero JVM.]) if test "x$enable_cds" = "xyes"; then AC_MSG_ERROR([CDS not implemented for variants zero, minimal, core. Remove --enable-cds.]) Fi Is it expected that cds goes away in "server" when configuring "--with-jvm-variants=minimal,server" ? Looks like a bug to me, should it be fixed (so that cds stays in the server jvm-feature list) ? Thanks, Matthias
Re: RFR: 8236714: enable link-time section-gc for linux to remove unused code
Hi Matthias, On 16/01/2020 6:10 pm, Baesken, Matthias wrote: Hi David, sure we can introduce a way to switch this on/off. Thanks. There is already something similar for the link-time optimization (flto) , see the feature JvmFeatures.gmk 180 ifeq ($(call check-jvm-feature, link-time-opt), true) 190 ifeq ($(call check-jvm-feature, link-time-opt), false) hotspot.m4 29 static-build link-time-opt aot jfr" 502 JVM_FEATURES_link_time_opt="link-time-opt" Yep familiar with that from Minimal VM and SE Embedded days :) Should we have "link-time-gc" additionally to " link-time-opt" ? (however it would be a bit misleading that it is a "JVM" feature , but except linux s390x it is only changing the build of the JDK libs) . I agree the definition of this as a "JVM" feature is a bit odd/misleading. Perhaps the build folk have a suggestion on how to refactor this kind of option into something more general? In the meantime having link-time-gc sit alongside link-time-opt seems acceptable to me. Thanks, David Best regards, Matthias Hi Matthias, I have reservations about turning this on by default and with no way to control it. This seems like it should be something you have to opt-in to initially while we gain some experience with it and ensure there are no unexpected side-effects. After that it could be enabled by default.
RE: RFR: 8236714: enable link-time section-gc for linux to remove unused code
Hi David, sure we can introduce a way to switch this on/off. There is already something similar for the link-time optimization (flto) , see the feature JvmFeatures.gmk 180 ifeq ($(call check-jvm-feature, link-time-opt), true) 190 ifeq ($(call check-jvm-feature, link-time-opt), false) hotspot.m4 29 static-build link-time-opt aot jfr" 502 JVM_FEATURES_link_time_opt="link-time-opt" Should we have "link-time-gc" additionally to " link-time-opt" ? (however it would be a bit misleading that it is a "JVM" feature , but except linux s390x it is only changing the build of the JDK libs) . Best regards, Matthias > > Hi Matthias, > > I have reservations about turning this on by default and with no way to > control it. This seems like it should be something you have to opt-in to > initially while we gain some experience with it and ensure there are no > unexpected side-effects. After that it could be enabled by default. >