I'm excited to announce the implementation of an improved conversion formula from cgroup v1 CPU shares to cgroup v2 CPU weight. This enhancement addresses critical issues with CPU priority allocation for Kubernetes workloads when running on systems with cgroup v2. Background Kubernetes was originally designed with cgroup v1 in mind, where CPU shares were derived from a container's CPU requests using the following formula: $$cpu.shares = milliCPU \times \frac{1024}{1000}$$Note that the value 1024 in this formula is the default cpu.shares value in cgroup v1, and is unrelated to millicores. For example, a container requesting 1 CPU (1000m) would get (cpu.shares = 1000 \times 1024 / 1000 = 1024), and a container requesting 100m would get (cpu.shares = 100 \times 1024 / 1000 = 102).