RFR: 8285246: AArch64: remove overflow check from InterpreterMacroAssembler::increment_mdp_data_at
Andrew Haley
aph at openjdk.java.net
Fri Apr 22 14:58:30 UTC 2022
On Fri, 22 Apr 2022 14:35:00 GMT, Nick Gasson <ngasson at openjdk.org> wrote:
> Several reasons to do this:
>
> - A 64-bit counter is realistically never going to overflow in the interpreter. The PPC64 port also doesn't check for overflow for this reason.
>
> - It's inconsistent with C1 which does not check for overflow. (See e.g. `LIRGenerator::profile_branch()` which does `__ leal(...)` to add and explicitly doesn't set the flags.)
>
> - We're checking for 64-bit overflow as the MDO cells are word-sized but accessors like `BranchData::taken()` silently truncate to uint which is 32 bit. So I don't think this check is doing anything useful.
>
> - I'd like to experiment with using LSE far atomics to update the MDO counters here, but the overflow check prevents that.
>
> Tested jtreg tier1-3 and also verified that the counters for a particular test method were the same before and after when run with -Xbatch.
I take your point.
Firstly, perhaps adjust Intel to be the same. Also, IIRC Gil Tene has spoken about the risk of counter values going backwards if atomic increments aren't used, and he believed it was a real risk, so +1 to investigating that. Finally, I have heard that on at least some large AArch64 implementations, LSE atomics can have very poor performance.
-------------
PR: https://git.openjdk.java.net/jdk/pull/8363
More information about the hotspot-compiler-dev
mailing list