[RFC containers] 8281571 Do not use CPU Shares to compute active processor count

Ioi Lam ioi.lam at oracle.com
Fri Feb 18 19:31:20 UTC 2022


Hi Folks,

I have filed the CSR https://bugs.openjdk.java.net/browse/JDK-8281571

Summary

Modify HotSpot's Linux-only container detection code to not use CPU Shares
(the "cpu.shares" file with cgroupv1 or "cpu.weight" file with cgroupv2,
exposed through the CgroupSubsystem::cpu_shares() API) to limit the 
number of
active processors that can be used by the JVM. Add a new flag (immediately
deprecated), UseContainerCpuShares, to restore the old behaviour; and
deprecate the existing PreferContainerQuotaForCPUCount flag.

Please refer to the CSR for the reasons for making this change, as well as
ways to address compatibility risks.

If you have any concerns, please let me know. Otherwise I plan to move the
CSR to "finalized" state and start RFR in two weeks.

Thanks to Severin Gehwolf and David Holmes for contributing to the CSR.

Best Regards
- Ioi



More information about the hotspot-dev mailing list