RFR: 8349722: [leyden] Option to block until preloading is complete [v2]
Aleksey Shipilev
shade at openjdk.org
Mon Feb 10 18:20:12 UTC 2025
On Mon, 10 Feb 2025 16:05:44 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:
>> src/hotspot/share/compiler/compileBroker.cpp line 1763:
>>
>>> 1761: bool is_blocking = ReplayCompiles ||
>>> 1762: !directive->BackgroundCompilationOption ||
>>> 1763: (PreloadBlocking && (compile_reason == CompileTask::Reason_Preload)) ||
>>
>> I was thinking may be set `BackgroundCompilation` flag to `false` temporary in `SCCache::preload_startup_code()` which loads all startup code. We do similar thing when dumping CS archive:
>> https://github.com/openjdk/leyden/blob/premain/src/hotspot/share/cds/cdsConfig.cpp#L547
>>
>> But I am not sure how such temporary setting affects `directive->BackgroundCompilationOption`.
>
> Oh. Let me try.
I don't think it works well. AFAICS, default compiler directives get initialized off the global `BackgroundCompilation` option at init time, through `DirectivesStack::init` during `CompilerBroker` init. The dumping CS path you linked above works, because it adjusts the global flag during arguments processing, before compiler broker is initialized.
For our use here, it is too late to flip `BackgroundCompilation` to `false` and back.
-------------
PR Review Comment: https://git.openjdk.org/leyden/pull/36#discussion_r1949656431
More information about the leyden-dev
mailing list