RFR: 8262953: [TESTBUG] Test /runtime/containers/cgroup/PlainRead.java fails if CPU quoata is not enabled

David Holmes dholmes at openjdk.java.net
Fri Apr 16 12:20:36 UTC 2021


On Thu, 25 Mar 2021 20:11:30 GMT, Anton Ostrouhhov <github.com+22177208+aostrouhhov at openjdk.org> wrote:

> Hello!
> Both _CPU Quota_ and _CPU Period_ are missing from output if kernel was built without `CONFIG_CFS_BANDWIDTH`.
> 
> This is my first contribution so please tell me if i am wrong somewhere.

I'm not sure my, simple, point is getting through.  Here's the cgroupv1 code:


/* cpu_quota
 *
 * Return the number of microseconds per period
 * process is guaranteed to run.
 *
 * return:
 *    quota time in microseconds
 *    -1 for no quota
 *    OSCONTAINER_ERROR for not supported
 */
int CgroupV1Subsystem::cpu_quota() {
  GET_CONTAINER_INFO(int, _cpu->controller(), "/cpu.cfs_quota_us",
                     "CPU Quota is: %d", "%d", quota);
  return quota;
}


But if GET_CONTAINER_INFO doesn't find /cpu.cfs_quota_us the macro does "return OSCONTAINER_ERROR" which is "return -2". Yet the spec states that if there is no quota then -1 is returned, so why are we not returning -1?

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

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


More information about the hotspot-runtime-dev mailing list