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

fixes for pkg/sysinfo/checkCgroupPids #162

Merged
merged 2 commits into from
May 23, 2020
Merged

Conversation

kolyshkin
Copy link
Contributor

@kolyshkin kolyshkin commented May 23, 2020

1. pkg/sysinfo.checkCgroupPids: fix error path

In case we failed to find out what version of cgroup we have,
it makes little sense to return that pids cgroup controller
is available, and yet the current code does it.

Fix this.

2. pkg/sysinfo.checkCgroupPids: speedup

For some reason this code chose not to use information already fetched,
and call cgroups.FindCgroupMountpoint() instead. This is not a cheap
call, as it has to parse the whole nine yards of /proc/self/mountinfo,
and the info it tries to get (whether the pids controller is present)
is already available from cgMounts map.

This also prepares the code for the upcoming changes in runc (opencontainers/runc#2411).

In case we failed to find out what version of cgroup we have,
it makes little sense to return that pids cgroup controller
is available, and yet the current code does it.

Fix this.

Signed-off-by: Kir Kolyshkin <[email protected]>
For some reason this code chose not to use information already fetched,
and call cgroups.FindCgroupMountpoint() instead. This is not a cheap
call, as it has to parse the whole nine yards of /proc/self/mountinfo,
and the info it tries to get (whether the pids controller is present)
is already available from cgMounts map.

Signed-off-by: Kir Kolyshkin <[email protected]>
@rhatdan
Copy link
Member

rhatdan commented May 23, 2020

@giuseppe
Copy link
Member

LGTM

@giuseppe giuseppe merged commit 4f08a5f into containers:master May 23, 2020
M1cha pushed a commit to M1cha/common that referenced this pull request Dec 20, 2022
dns: Add support for `DNS` with containers via `aardvark`.
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.

3 participants