RFR: 8281936: compiler/arguments/TestCodeEntryAlignment.java fails on AVX512 machines [v2]
Jie Fu
jiefu at openjdk.java.net
Fri Feb 18 03:41:53 UTC 2022
On Thu, 17 Feb 2022 19:46:03 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:
> I would like to hear explanation why the test failed with `-XX:CodeEntryAlignment=16` on avx512 when it passed with bigger default value 32 (or other bigger values):
> https://github.com/openjdk/jdk/blob/master/src/hotspot/cpu/x86/globals_x86.hpp#L47
Let's see the code buffer size after line 3005 with CodeEntryAlignment={16, 32, 64}
2999 RuntimeStub* SharedRuntime::generate_resolve_blob(address destination, const char* name) {
3000 assert (StubRoutines::forward_exception_entry() != NULL, "must be generated before");
3001
3002 // allocate space for the code
3003 ResourceMark rm;
3004
3005 CodeBuffer buffer(name, 1000, 512);
3006 MacroAssembler* masm = new MacroAssembler(&buffer);
3007
3008 int frame_size_in_words;
The `insts.code` is only 1128 for `CodeEntryAlignment=16` which is not enough on AVX512.
CodeEntryAlignment=16
CodeBuffer:
consts.code = 0x0000000000000000 : 0x0000000000000000 : 0x0000000000000000 (0 of 0)
consts.locs = 0x0000000000000000 : 0x0000000000000000 : 0x0000000000000000 (0 of 0) point=0
insts.code = 0x00007fffd90adc90 : 0x00007fffd90adc90 : 0x00007fffd90ae0f8 (0 of 1128)
insts.locs = 0x00007ffff0027098 : 0x00007ffff0027098 : 0x00007ffff0027298 (0 of 256) point=0
stubs.code = 0x0000000000000000 : 0x0000000000000000 : 0x0000000000000000 (0 of 0)
stubs.locs = 0x0000000000000000 : 0x0000000000000000 : 0x0000000000000000 (0 of 0) point=0
CodeEntryAlignment=32
CodeBuffer:
consts.code = 0x0000000000000000 : 0x0000000000000000 : 0x0000000000000000 (0 of 0)
consts.locs = 0x0000000000000000 : 0x0000000000000000 : 0x0000000000000000 (0 of 0) point=0
insts.code = 0x00007fffd90add20 : 0x00007fffd90add20 : 0x00007fffd90ae208 (0 of 1256)
insts.locs = 0x00007ffff0027098 : 0x00007ffff0027098 : 0x00007ffff0027298 (0 of 256) point=0
stubs.code = 0x0000000000000000 : 0x0000000000000000 : 0x0000000000000000 (0 of 0)
stubs.locs = 0x0000000000000000 : 0x0000000000000000 : 0x0000000000000000 (0 of 0) point=0
CodeEntryAlignment=64
CodeBuffer:
consts.code = 0x0000000000000000 : 0x0000000000000000 : 0x0000000000000000 (0 of 0)
consts.locs = 0x0000000000000000 : 0x0000000000000000 : 0x0000000000000000 (0 of 0) point=0
insts.code = 0x00007fffd90adec0 : 0x00007fffd90adec0 : 0x00007fffd90ae4a8 (0 of 1512)
insts.locs = 0x00007ffff0027098 : 0x00007ffff0027098 : 0x00007ffff0027298 (0 of 256) point=0
stubs.code = 0x0000000000000000 : 0x0000000000000000 : 0x0000000000000000 (0 of 0)
stubs.locs = 0x0000000000000000 : 0x0000000000000000 : 0x0000000000000000 (0 of 0) point=0
The related code logic at line 100 & 105, which shows larger `insts.code` with higher `CodeEntryAlignment`.
98 void CodeBuffer::initialize(csize_t code_size, csize_t locs_size) {
99 // Compute maximal alignment.
100 int align = _insts.alignment(); // <--- will return CodeEntryAlignment
101 // Always allow for empty slop around each section.
102 int slop = (int) CodeSection::end_slop();
103
104 assert(blob() == NULL, "only once");
105 set_blob(BufferBlob::create(_name, code_size + (align+slop) * (SECT_LIMIT+1)));
-------------
PR: https://git.openjdk.java.net/jdk/pull/7485
More information about the hotspot-compiler-dev
mailing list