RFR: 8314220: Configurable InlineCacheBuffer size [v3]
Vladimir Kozlov
kvn at openjdk.org
Tue Nov 21 03:46:09 UTC 2023
On Tue, 21 Nov 2023 01:40:26 GMT, Dean Long <dlong at openjdk.org> wrote:
>> src/hotspot/share/compiler/compilerDefinitions.cpp line 503:
>>
>>> 501: jio_fprintf(defaultStream::error_stream(),
>>> 502: "Invalid InlineCacheBufferSize=" SIZE_FORMAT "K. Must be less than NonNMethodCodeHeapSize=" SIZE_FORMAT "K.\n",
>>> 503: InlineCacheBufferSize/K, NonNMethodCodeHeapSize/K);
>>
>> You need to check for alignment of the value. In [StubQueue()](https://github.com/openjdk/jdk/blob/master/src/hotspot/share/code/stubs.cpp#L70) it is aligned up by `2*BytesPerWord` so the final value could be > `InlineCacheBufferSize`.
>
> I think the align up to 2*BytesPerWord is not really need, because BufferBlob::create already does its own alignment which will make the final value > InlineCacheBufferSize. BufferBlob::create uses the size as a minimum, not a maximum.
> I don't think the above check should need to know the details of BufferBlob::create and StubQueue() alignment adjustments. Having InlineCacheBufferSize near to NonNMethodCodeHeapSize is going the make the JVM fail in startup for other reasons, isn't it? Maybe the max for InlineCacheBufferSize should be NonNMethodCodeHeapSize/2?
Thank you for answering my questions, Dean.
Yes, non-nmethod section contains template Interpreter code, stubs and adapters. So it will fail immediately if no space left for it. NonNMethodCodeHeapSize/2 is reasonable limit.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/15271#discussion_r1399992871
More information about the hotspot-dev
mailing list