[riscv-port] RFR: 8281632: riscv: Improve interpreter stack banging

Aleksey Shipilev shade at openjdk.java.net
Tue Feb 22 06:59:15 UTC 2022


On Tue, 22 Feb 2022 06:28:56 GMT, Yadong Wang <yadongwang at openjdk.org> wrote:

> With reference to https://bugs.openjdk.java.net/browse/JDK-8072070, there is the same issue on the riscv platform.
>  
> 
> Every time we enter a method in interpreter, we bang a lot of stack ahead for shadow zone checks. I believe this could be made significantly better, e.g. by checking how far away we are from the stack_overflow_limit.
> 
> 
> Hotspot/jdk tier1 passed on unmatched, and all jtreg cases were tested on Qemu without new failures.
> 
> Performed the performance regression test in SPECjvm2008 sunflow, and achieved 17% improvement in the interpreter-only mode.

src/hotspot/cpu/riscv/templateInterpreterGenerator_riscv.cpp line 910:

> 908:   __ stop("shadow zone safe limit is not initialized");
> 909:   __ bind(L_good_limit);
> 910: #endif

The x86 patch also verifies `shadow_zone_growth_watermark()`, do you want to do the same?

https://github.com/openjdk/jdk/commit/3a13425bc9088cbb6d95e1a46248d7eba27fb1a6#diff-b43598c71e4c69b246ff38275b5d421bcbbc3141216aa03f50fc747dd2635922R742-R746

src/hotspot/cpu/riscv/templateInterpreterGenerator_riscv.cpp line 922:

> 920: 
> 921:   // Record a new watermark, unless the update is above the safe limit.
> 922:   // Otherwise, the next time around a check above would pass the safe limit.

Hah. I noticed this is worded incorrectly in the original x86 change. See https://github.com/openjdk/jdk/pull/7569 -- probably makes sense to wait a bit for that change to land, and then pick up the same wording here?

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

PR: https://git.openjdk.java.net/riscv-port/pull/58


More information about the riscv-port-dev mailing list