RFR: 8356000: C1/C2-only modes use 2 compiler threads on low CPU count machines [v2]

Aleksey Shipilev shade at openjdk.org
Wed May 28 16:01:23 UTC 2025


On Wed, 30 Apr 2025 19:42:41 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:

>> src/hotspot/share/compiler/compilationPolicy.cpp line 471:
>> 
>>> 469:         count = MAX2(max_count, min_count);
>>> 470:       }
>>> 471:       assert((!c1_only && !c2_only) || count <= active_cpus, "Too many threads: %d", count);
>> 
>> Should it be the general rule: don't create more compiler threads than available cpus?
>
> Except when specified on command line with `-XX:CICompilerCount=n`.
> Actually your changes does not take this flag into account.

I think we should allow users to run with more threads than CPUs, if they really want it. (This is also handy for testing the heuristics for very large CPU counts without having too many real CPUs.) What we surely need to do is to teach _heuristics_ never go over the CPU count. I now added the more precise test that explores `CICompilerCount` settings as well, verifying heuristics works as expected.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24972#discussion_r2112250542


More information about the hotspot-compiler-dev mailing list