RFR: 8281181: Do not use CPU Shares to compute active processor count [v2]

Ioi Lam iklam at openjdk.java.net
Thu Mar 3 07:09:34 UTC 2022


> This is a simple change (Linux-only) that removes the consideration of Cgroups CPU Shares from the active process count calculation. Of note, this fixes CPU underutilization when Java is executed by Kubernetes without CPU resources limits. 
> 
> Please see the CSR [JDK-8281571](https://bugs.openjdk.java.net/browse/JDK-8281571) for a detailed discussion of the reasons to make this change.
> 
> To err on the side of caution, we added a temporary (and deprecated) VM flag `-XX:+UseContainerCpuShares` to enable the old behavior. We believe the old behavior is wrong and unnecessary. The plan is to remove the old behavior in JDK 20.
> 
> The associated flag, `PreferContainerQuotaForCPUCount` is also deprecated. Both flags will be obsoleted in JDK 20.
> 
> Testing with tiers 1-4, as well as container tests in tier5.

Ioi Lam has updated the pull request incrementally with one additional commit since the last revision:

  @dholmes-ora comments

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

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/7666/files
  - new: https://git.openjdk.java.net/jdk/pull/7666/files/9ffd57d0..1e0f289f

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=7666&range=01
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=7666&range=00-01

  Stats: 4 lines in 3 files changed: 2 ins; 0 del; 2 mod
  Patch: https://git.openjdk.java.net/jdk/pull/7666.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/7666/head:pull/7666

PR: https://git.openjdk.java.net/jdk/pull/7666


More information about the hotspot-dev mailing list