[aarch64-port-dev ] RFR (XS) 8252096: Shenandoah: adjust SerialPageShiftCount for x86_32 and JFR

Andrew Hughes gnu.andrew at redhat.com
Thu Aug 27 05:38:48 UTC 2020


On 15:03 Thu 20 Aug     , Aleksey Shipilev wrote:
> Hi,
> 
> Once I added bootcycle-images to x86_32 test configurations, this failure was discovered:
> 
> #  Internal Error (/home/shade/trunks/shenandoah-jdk8/hotspot/src/share/vm/runtime/os.cpp:1280),
> pid=490815, tid=0xf5fefb40
> #  assert(SerializePageShiftCount == count) failed: thread size changed, fix
> SerializePageShiftCount constant
> 
> It happens when all three things hold true:
>   - JFR is enabled at build time
>   - Shenandoah is enabled at build time (i.e. the build config is not "minimal1")
>   - 32-bit VM is being built
> 
> Therefore, it only affects aarch64-port/jdk8u-shenandoah, and here is the
> minimal fix that adjusts the constant when all three things are in effect at
> the same time:
> 
> diff -r ed70d5208f5f src/share/vm/utilities/globalDefinitions.hpp
> --- a/src/share/vm/utilities/globalDefinitions.hpp      Mon Jun 22 20:26:02 2020 +0800
> +++ b/src/share/vm/utilities/globalDefinitions.hpp      Thu Aug 20 13:03:44 2020 +0200
> @@ -143,12 +143,18 @@
>  // log2_intptr(sizeof(class JavaThread)) - log2_intptr(64);
>  // see os::set_memory_serialize_page()
>  #ifdef _LP64
>  const int SerializePageShiftCount = 4;
>  #else
> +#if INCLUDE_JFR && INCLUDE_ALL_GCS
> +// JavaThread already has quite a few Shenandoah fields. Adding many JFR fields
> +// trips sizeof(JavaThread) > 1024. Need to adjust it here.
> +const int SerializePageShiftCount = 4;
> +#else
>  const int SerializePageShiftCount = 3;
>  #endif
> +#endif
> 
>  // An opaque struct of heap-word width, so that HeapWord* can be a generic
>  // pointer into the heap.  We require that object sizes be measured in
>  // units of heap words, so that that
>  //   HeapWord* hw;
> 
> 
> Testing: Linux {x86_64, x86_32} x {zero, minimal1, server} x {default, jfr} bootcycle-images build
> 
> -- 
> Thanks,
> -Aleksey
> 

This is the same issue I found when building x86 RPMs, as mentioned here:

https://mail.openjdk.java.net/pipermail/jdk8u-dev/2020-June/012016.html

How did you find the correct value? I've been considering backporting
https://bugs.openjdk.java.net/browse/JDK-8152358 as it makes the assert
print the expected value.

Anyway, if it only applies when Shenandoah + JFR are in operation, it explains
why Azul have not seen it on upstream 8u. Change looks good to me and it will
be good to get this fixed and JFR enabled on our x86 builds.

Thanks,
-- 
Andrew :)

Senior Free Java Software Engineer
OpenJDK Package Owner
Red Hat, Inc. (http://www.redhat.com)

PGP Key: ed25519/0xCFDA0F9B35964222 (hkp://keys.gnupg.net)
Fingerprint = 5132 579D D154 0ED2 3E04  C5A0 CFDA 0F9B 3596 4222


More information about the aarch64-port-dev mailing list