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

libct/cgroups/fs: simple optimization #2495

Merged
merged 1 commit into from
Jul 7, 2020
Merged

Conversation

kolyshkin
Copy link
Contributor

@kolyshkin kolyshkin commented Jul 3, 2020

this is separated out from #2438 in order to make review easier

This adds a very simple and straightforward optimization.

Should be very easy to review.

@kolyshkin
Copy link
Contributor Author

This drastically reduces the number of calls to FindCgroupMountpoint
during container start (from 116 to 62 in my setup).

Note this code was written and the measurements were done before merging #2446. Now the savings should be less dramatic, but still major.

@kolyshkin kolyshkin changed the title libct/cgroups/fs: various nits + optimization libct/cgroups/fs: various nits + simple optimization Jul 3, 2020
The result of cgroupv1.FindCgroupMountpoint() call (which is relatively
expensive) is only used in case raw.innerPath is absolute, so it only
makes sense to call it in that case.

This drastically reduces the number of calls to FindCgroupMountpoint
during container start (from 116 to 62 in my setup).

Signed-off-by: Kir Kolyshkin <[email protected]>
@kolyshkin kolyshkin changed the title libct/cgroups/fs: various nits + simple optimization libct/cgroups/fs: simple optimization Jul 3, 2020
@kolyshkin
Copy link
Contributor Author

@AkihiroSuda @cyphar PTAL (easy to review)

Copy link
Member

@cyphar cyphar left a comment

Choose a reason for hiding this comment

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

LGTM.

@cyphar cyphar closed this in 819fcc6 Jul 7, 2020
@cyphar cyphar merged commit 819fcc6 into opencontainers:master Jul 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants