RFR: 8272791: java -XX:BlockZeroingLowLimit=1 crashes after 8270947

Aleksey Shipilev shade at openjdk.java.net
Wed May 18 06:30:53 UTC 2022


On Tue, 17 May 2022 18:08:58 GMT, Andrew Haley <aph at openjdk.org> wrote:

> This is an assertion failure caused by setting `BlockZeroingLowLimit` < `wordSize`.
> 
> I believe there was some confusion when writing this code about whether `BlockZeroingLowLimit` should be in words or bytes, and it makes no sense for it to be less than a single word. If anyone ever tried to use a parameter < 8, it triggers an assertion.
> 
> This patch does two things. Firstly, it corrects a `guarantee` which erroneously used `zero_words_block_size` rather than `wordSize`. The value of both of these is 8, so it doesn't change anything in the generated code. Secondly, it clips the `BlockZeroingLowLimit` so that it doesn't trigger the assertion.
> 
> Perhaps it would be better to change the lower limit to 8 instead of this silent correction. There is no backward compatibility issue here, because any attempt to set `BlockZeroingLowLimit` < 8 in the past would have exited the VM with an error, so I don't believe a CSR is warranted if we do change the allowable range.
> 
> So, which should it be? Change the lower limit of the range of the `BlockZeroingLowLimit` system flag, or allow 1 still to be used and silently fix it? Opinions welcome.

Why not just do:


diff --git a/src/hotspot/cpu/aarch64/globals_aarch64.hpp b/src/hotspot/cpu/aarch64/globals_aarch64.hpp
index 56fc873267d..b6310127a4d 100644
--- a/src/hotspot/cpu/aarch64/globals_aarch64.hpp
+++ b/src/hotspot/cpu/aarch64/globals_aarch64.hpp
@@ -105,7 +105,7 @@ define_pd_global(intx, InlineSmallCode,          1000);
           "Use DC ZVA for block zeroing")                               \
   product(intx, BlockZeroingLowLimit, 256,                              \
           "Minimum size in bytes when block zeroing will be used")      \
-          range(1, max_jint)                                            \
+          range(wordSize, max_jint)                                     \
   product(bool, TraceTraps, false, "Trace all traps the signal handler")\
   product(int, SoftwarePrefetchHintDistance, -1,                        \
           "Use prfm hint with specified distance in compiled code."     \


?

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

PR: https://git.openjdk.java.net/jdk/pull/8756


More information about the hotspot-dev mailing list