-
Notifications
You must be signed in to change notification settings - Fork 37
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
Add cgroup v2 support #12
Comments
Hi @drakenclimber, I am asking you since I am interested in keeping libcgroup in good shape in Debian (specifically since mininet depends on it), and currently, it will be removed from the next stable distribution by the lack of cgroup2 support. i.e. https://bugs.debian.org/959022. So I am keeping an eye on this. P.S. This should be maybe another issue, do you have the means to make https://sourceforge.net/projects/libcg/ point to your git repo? |
@santiagorr, Glad to help :).
Unfortunately, I don't. libcgroup is one of many hats that I wear, and my work on it is sporadic. As you can see, though, we have some lofty goals.
I agree; another release is long overdue. This is definitely on my todo list soon. I'll try to get it out in the next couple weeks.
Thanks for the link. I'll do my best to help keep libcgroup in Debian.
Agreed. I don't have admin privileges for the old sourceforge repo, but I can reach out to the previous owners. Hopefully they can make the update. Thanks! |
@drakenclimber, a couple of comments/questions about this cgroupv2 support:
/sys/fs/cgroup/tmp/cgroup.controllers /sys/fs/cgroup/tmp/cpu.pressure /sys/fs/cgroup/tmp/io.stat /sys/fs/cgroup/tmp/memory.pressure
/sys/fs/cgroup/tmp/cgroup.events /sys/fs/cgroup/tmp/cpuset.cpus /sys/fs/cgroup/tmp/io.weight /sys/fs/cgroup/tmp/memory.stat
/sys/fs/cgroup/tmp/cgroup.freeze /sys/fs/cgroup/tmp/cpuset.cpus.effective /sys/fs/cgroup/tmp/memory.current /sys/fs/cgroup/tmp/memory.swap.current
/sys/fs/cgroup/tmp/cgroup.max.depth /sys/fs/cgroup/tmp/cpuset.cpus.partition /sys/fs/cgroup/tmp/memory.events /sys/fs/cgroup/tmp/memory.swap.events
/sys/fs/cgroup/tmp/cgroup.max.descendants /sys/fs/cgroup/tmp/cpuset.mems /sys/fs/cgroup/tmp/memory.events.local /sys/fs/cgroup/tmp/memory.swap.high
/sys/fs/cgroup/tmp/cgroup.procs /sys/fs/cgroup/tmp/cpuset.mems.effective /sys/fs/cgroup/tmp/memory.high /sys/fs/cgroup/tmp/memory.swap.max
/sys/fs/cgroup/tmp/cgroup.stat /sys/fs/cgroup/tmp/cpu.stat /sys/fs/cgroup/tmp/memory.low /sys/fs/cgroup/tmp/pids.current
/sys/fs/cgroup/tmp/cgroup.subtree_control /sys/fs/cgroup/tmp/cpu.weight /sys/fs/cgroup/tmp/memory.max /sys/fs/cgroup/tmp/pids.events
/sys/fs/cgroup/tmp/cgroup.threads /sys/fs/cgroup/tmp/cpu.weight.nice /sys/fs/cgroup/tmp/memory.min /sys/fs/cgroup/tmp/pids.max
/sys/fs/cgroup/tmp/cgroup.type /sys/fs/cgroup/tmp/io.max /sys/fs/cgroup/tmp/memory.numa_stat
/sys/fs/cgroup/tmp/cpu.max /sys/fs/cgroup/tmp/io.pressure /sys/fs/cgroup/tmp/memory.oom.group or, using cgroup-tools: wouldn't make sense to create a "unified" group like this:
Thanks! |
As of right now, all of the tools (cgset, cgcreate, etc.) have the exact same usage for both cgroup v1 and cgroup v2, and I would like to keep these tools consistent with old libcgroup releases for one more release - v0.43. Once release v0.43 is out (hopefully in a month or so), then I am open to hearing ideas on how to improve these interfaces and potentially even break backward compatibility. I haven't thought about it too deeply, but at first glance I think your request of Anyway :), onto your question. cgset supports two major usages - I created two v2 cgroups as follows: To set a single value in foo, you can do the following: And just to verify it worked properly:
Or you can copy an entire cgroup's settings to another cgroup, e.g. And let's verify the
|
Understood!
Stupid me... I had tried setting However, I still have a resource (
Am I doing something wrong? Thanks! |
No worries :). For most cgroup settings, you can also change the ownership/permission bits of the setting if you would prefer to avoid using sudo.
Nope, it appears that you've found a bug in cgset. cgset is using I have hacked together a fix, but I would like to make it better and add a test around it. I'll file a bug to ensure it gets into v0.43. Good find. Thank you! |
All tools now support cgroup v2 and have some level of automated testing. |
When is a release that will contain this new v2 support planned? Will it get into v0.43.0? |
@pxeger we are planning something for next week. The version number will probably be 2.0 - with expectation that the v2 cycle will have continously breaking ABI. When we are happy where it is, we will push out v3 which will then maintain ABI through its lifetime. |
@pxeger - v2.0.rc1 is available here: While doing the release, I noticed a few small things I would like to clean up. We're aiming for next week for the actual release. Thanks! |
Regarding versioning I would recommend eventually also releasing at least one 1.0 version with the now very stable cgroup v1 support for general usage on legacy and not so legacy systems. The 2.0 version is then ideal continuation with the v2 support. |
…sts2 Add functional tests for cgconfigparser
This issue is to track the addition of cgroup v2 support to the various tools in libcgroup.
Below is the list of libcgroup's current applications and their cgroup v2 status:
/usr/bin/
/usr/sbin/
The text was updated successfully, but these errors were encountered: