RFR: 8365991: AArch64: Ignore BlockZeroingLowLimit when UseBlockZeroing is false [v4]

Andrew Haley aph at openjdk.org
Tue Oct 28 12:11:04 UTC 2025


On Tue, 28 Oct 2025 08:53:02 GMT, Patrick Zhang <qpzhang at openjdk.org> wrote:

> > > I would like to reiterate that I have no objection to the functions when the `-XX:+UseBlockZeroing` option is set, everything can keep as is. My point is that `BlockZeroingLowLimit` serves literally/specifically as a switch to control whether DC ZVA instructions are generated for clearing instances under a specified bytes size limitation, rather than for deciding between unrolling and callout. Therefore, it should NOT affect the code-gen results any longer when `-XX:-UseBlockZeroing` is set, should it?
> > 
> > 
> > It does not. When `-XX:-UseBlockZeroing` is set, `BlockZeroingLowLimit` is ignored.
> 
> zero_words does not check `UseBlockZeroing`, it directly compares `cnt` and `BlockZeroingLowLimit / BytesPerWord`.

It doesn't need to because


  if (!UseBlockZeroing && !FLAG_IS_DEFAULT(BlockZeroingLowLimit)) {
    warning("BlockZeroingLowLimit has been ignored because UseBlockZeroing is disabled");
    FLAG_SET_DEFAULT(BlockZeroingLowLimit, is_zva_enabled() ? (4 * VM_Version::zva_length()) : 256);
  }


That is to say, if a user sets `BlockZeroingLowLimit` and `-XX:-UseBlockZeroing`, then the user's `BlockZeroingLowLimit` is, rightly, ignored.

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

PR Comment: https://git.openjdk.org/jdk/pull/26917#issuecomment-3456150098


More information about the hotspot-dev mailing list