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

Added cgroups v2 CPU implementation. #107

Merged

Conversation

Zyqsempai
Copy link
Contributor

Partially fixes #104
Added cgroups v2 CPU implementation.

Signed-off-by: bpopovschi zyqsempai@mail.ru

@Zyqsempai
Copy link
Contributor Author

@AkihiroSuda Can you add some acceptance criteria or checkpoints what should be done, for easier testing and validation for this and next PR's.

@codecov-io
Copy link

codecov-io commented Nov 4, 2019

Codecov Report

Merging #107 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #107   +/-   ##
=======================================
  Coverage   45.42%   45.42%           
=======================================
  Files          23       23           
  Lines        1638     1638           
=======================================
  Hits          744      744           
  Misses        768      768           
  Partials      126      126

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6fb48e1...8f1875b. Read the comment docs.

v2/cpu.go Outdated Show resolved Hide resolved
@AkihiroSuda
Copy link
Member

Please add to

func defaults(unifiedMountpoint string) ([]Subsystem, map[Name]error) {

@AkihiroSuda
Copy link
Member

wrt tests I think we can add metrics code to cmd/cgroups-playground and call it a day.

In future we should have proper Go tests

Copy link
Member

@AkihiroSuda AkihiroSuda left a comment

Choose a reason for hiding this comment

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

@Zyqsempai
Copy link
Contributor Author

@AkihiroSuda The problem is that https://github.com/opencontainers/runtime-spec/blob/master/specs-go/config.go#L297 this config still not updated to v2.
Should I open an issue and corresponding PR to runtime-spec?
For example how it's done in runc https://github.com/opencontainers/runc/blob/master/libcontainer/configs/cgroup_linux.go#L123

@AkihiroSuda
Copy link
Member

@Zyqsempai
Copy link
Contributor Author

@AkihiroSuda PTAL

v2/cpu.go Show resolved Hide resolved
v2/stats/metrics.proto Outdated Show resolved Hide resolved
@AkihiroSuda
Copy link
Member

thanks, just a couple of nits

@Zyqsempai
Copy link
Contributor Author

@AkihiroSuda Thanks for your reviews. Done.

Copy link
Member

@AkihiroSuda AkihiroSuda left a comment

Choose a reason for hiding this comment

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

LGTM, thanks

Signed-off-by: bpopovschi <zyqsempai@mail.ru>
@crosbymichael
Copy link
Member

One thing before we go farther on this. Should v2 be simpler where we don't have separate files/controllers, cpu.go/memory.go but a single manager.go with all the settings?

@AkihiroSuda
Copy link
Member

Good idea, could you open PR? (maybe after merging this one)

@crosbymichael
Copy link
Member

Ya, I think we should merge then one and then i can work on a unified manager :)

@crosbymichael
Copy link
Member

LGTM

@AkihiroSuda after this last edit, does it still LGTM for you?

@AkihiroSuda AkihiroSuda merged commit 2ff88b8 into containerd:master Nov 5, 2019
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.

cgroup2: check list for v2 controller implementations
4 participants