RFR: 8072070: Improve interpreter stack banging

Aleksey Shipilev shade at openjdk.java.net
Sat Feb 5 07:31:40 UTC 2022


On Sat, 5 Feb 2022 01:28:47 GMT, Xin Liu <xliu at openjdk.org> wrote:

> since you this PR touches stackoverflow.hpp, Could you also take a look at this? https://github.com/openjdk/jdk/blob/master/src/hotspot/share/runtime/stackOverflow.cpp#L66
> 
> we actually get the page size from os. why do we need alignment = 4k?

Look here: https://github.com/openjdk/jdk/blob/48523b090886f7b24ed4009f0c150efaa6f7b056/src/hotspot/share/runtime/stackOverflow.cpp#L42-L45 -- the `StackYellowPages`, `StackRedPages`, `StackShadowPages` are defined in as 4K pages. It should probably be called `unit`, not `alignment`. I'd like to avoid scope creep for this PR, so that's for another day.

> src/hotspot/cpu/x86/templateInterpreterGenerator_x86.cpp line 715:
> 
>> 713: }
>> 714: 
>> 715: void TemplateInterpreterGenerator::bang_stack_shadow_pages(bool native_call) {
> 
> The watermark algorithm should also work on other architectures such as aarch64, right?

Yes, as I stated in PR text: "This patch makes a pilot change for x86, without touching other architectures. Other architectures can follow this example later. "

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

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


More information about the hotspot-dev mailing list