On Thu, 7 Jan 2021 20:50:50 GMT, Chris Plummer <cjplum...@openjdk.org> wrote:
>> Igor Veresov has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Fix s390 build > > test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/hotswap/HS203/hs203t004/hs203t004.java > line 35: > >> 33: * While running the thread, it calls a method (doTask2() ) for >> number of times (10000). >> 34: * That would cause this method to be compiled, which causes a jvmti >> callback for compiled method load. >> 35: * (Hint : to force method compilation -XX:CompileThreshold=900 is >> used). > > The test still uses (and the comments state it uses) -XX:CompileThreshold=900 > to force compilation, yet it looks like you needed to bump the number of > times the method is called from 1000 to 10000 to keep this test working. Why > doesn't 1000 still work? Tiered policy (which the -TieredCompilation emulation mode piggybacks on now) functions by doing periodic callbacks into the runtime to make policy decisions. The callback intervals are a power-of-2. So, because of the resulting rounding I cannot guarantee that the compilation will be triggered exactly at the specified threshold. Plus there are various adaptive mechanisms that I kept on even in the emulation mode that may also result in a method being compiled later than expected. To summarize, in the new world, the advisable way of triggering a compilation is to use the WB API. If that's too much effort, make sure that the method that you'd like to compile is invoked more than 2^(log2(CompileThreshold) + 1) times, plus a bit more. Very few tests actually depend on the legacy behavior, this just happens to be one of those. ------------- PR: https://git.openjdk.java.net/jdk/pull/1985