Skip to content
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

linux: clarify pids cgroup settings #1279

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

cyphar
Copy link
Member

@cyphar cyphar commented Feb 27, 2025

While the original wording did not provide any justification for this,
some runtimes have incorrectly treated a pids.limit value of 0 as being
equivalent to "max" or otherwise handle it suboptimally.

So, add some clarifying wording that the correct representation of max
is -1 (like every other cgroup configuration) and that users should not
treat 0 as a special value of any kind.

Note that a pids.limit value of 0 is actually different to 1 now that
CLONE_INTO_CGROUP exists (at the time pids was added to the kernel and
the spec, this feature didn't exist and so it may have seemed redundant
to have two equivalent values).

Signed-off-by: Aleksa Sarai [email protected]

While the original wording did not provide any justification for this,
some runtimes have incorrectly treated a pids.limit value of 0 as being
equivalent to "max" or otherwise handle it suboptimally.

So, add some clarifying wording that the correct representation of max
is -1 (like every other cgroup configuration) and that users should not
treat 0 as a special value of any kind.

Note that a pids.limit value of 0 is actually different to 1 now that
CLONE_INTO_CGROUP exists (at the time pids was added to the kernel and
the spec, this feature didn't exist and so it may have seemed redundant
to have two equivalent values).

Signed-off-by: Aleksa Sarai <[email protected]>
* **`limit`** *(int64, REQUIRED)* - specifies the maximum number of tasks in the cgroup
* **`limit`** *(int64, REQUIRED)* - specifies the maximum number of tasks in the cgroup, with `-1` indicating no limit (`max`).

> Note: Even though it superficially seems redundant, `0` is a valid limit value for the `pids` cgroup controller and SHOULD NOT be treated as a special value.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
> Note: Even though it superficially seems redundant, `0` is a valid limit value for the `pids` cgroup controller and SHOULD NOT be treated as a special value.
> Note: Even though it superficially seems redundant, `0` is a valid limit value for the `pids` cgroup controller from kernel's perspective, and SHOULD NOT be treated as "no limit". An implementation may reject `0`.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants