Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8370492

[Linux] Update cpu shares to cpu.weight mapping function

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • None
    • openjdk8u472, 26
    • hotspot
    • Cause Known
    • generic
    • linux

      Kubernetes and other container runtimes changed the mapping function from --cpu-shares values to cgroups v2 cpu.weight value. Originally the function was (y=cpu.weight, x=cpu-shares):

      y = (1 + ((x - 2) * 9999) / 262142)

      This changed to:

      y=10^((log2(x)^2 + 125 * log2(x)) / 612.0 - 7.0 / 34.0)

      See also:
      https://github.com/containers/crun/issues/1721
      https://github.com/containers/crun/commit/4998c928494c563f8d06494a1f2ed3443de29c2b

      We need to adjust the container detection code to this new function.

            sgehwolf Severin Gehwolf
            sgehwolf Severin Gehwolf
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: