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

XMLWordPrintable

    • b25
    • 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/612 + 125/612 * log2(x) - 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.

              Assignee:
              Severin Gehwolf
              Reporter:
              Severin Gehwolf
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: