RFR: 8333446: Add tests for hierarchical container support [v3]

Severin Gehwolf sgehwolf at openjdk.org
Thu Jul 11 09:26:55 UTC 2024


On Thu, 11 Jul 2024 03:42:27 GMT, Jan Kratochvil <jkratochvil at openjdk.org> wrote:

> [test.patch.txt](https://github.com/user-attachments/files/16171122/test.patch.txt)
> 
>     * `CPUQuota` (changed it to `AllowedCPUs`) does not work for me - it properly distributes the load but JDK still sees all available CPU cores (4 of my VM).

Could you elaborate on that? What does not work? It's relying on the JVM properly detecting the set limit. `CPUQuota` sets the values in `cpu.max` on unified hierarchy for the `cpu` controller. See the [systemd doc](https://www.freedesktop.org/software/systemd/man/latest/systemd.resource-control.html). It's available since systemd 213. RHEL 7 has 219 which should be good enough. `AllowedCPUs` on the other hand uses the `cpuset` controller, which is a different thing. For the purpose of this test, we should use `CPUQuota`.
 
>     * the change 2 -> 1 cores: // We could check 2 cores ("0-1") but then it would fail on single-core nodes / virtual machines.

Yeah, we have a chicken/egg problem there. It seemed assuming 2 cores is reasonable. We could query the number of not restricted CPUs (of the physical system) using the WB API and take the minimum of the two. Let me work on that.

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

PR Comment: https://git.openjdk.org/jdk/pull/19530#issuecomment-2222448285


More information about the core-libs-dev mailing list