-
Notifications
You must be signed in to change notification settings - Fork 554
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow negative value for some resource fields #648
Conversation
Carry opencontainers#499 For these values, cgroup kernal APIs accept -1 to set them as unlimited, as docker and runc all support update resources, we should not set drawbacks in spec. Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
@@ -283,15 +283,15 @@ For more information, see [the memory cgroup man page][cgroup-v1-memory]. | |||
|
|||
The following parameters can be specified to setup the controller: | |||
|
|||
* **`limit`** *(uint64, OPTIONAL)* - sets limit of memory usage in bytes | |||
* **`limit`** *(int64, OPTIONAL)* - sets limit of memory usage in bytes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These properties are not tied directly to their backing cgroup property. I think we should either:
a. Be explicit about the cgroup property which MUST be used to satisfy the configuration (in which case the kernel docs will explain the 0 and -1 cases) or
b. Explicitly define the 0 and -1 cases here.
LGTM IMO the additional clarity as to why this is an |
This partially revert opencontainers#648 , after a second thought, I think we should use specs value the same as kernel API input, see: opencontainers#692 (comment) For memory and hugetlb limits *.limit_in_bytes, cgroup APIs take the values as string, but the parsed values are unsigned long, see: https://github.com/torvalds/linux/blob/v4.10/mm/page_counter.c#L175-L193 For `cpu.cfs_quota_us` and `cpu.rt_runtime_us`, cgroup APIs take the input value as signed long long, while `cpu.cfs_period_us` and `cpu.rt_periof_us` take the input value as unsigned long long. Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
Carry #499
For these values, cgroup kernal APIs accept -1 to set
them as unlimited, as docker and runc all support
update resources, we should not set drawbacks in spec.
Signed-off-by: Qiang Huang h.huangqiang@huawei.com