| Summary: | the cgroup parameter ‘ControlGroupAttribute’ doesn’t work | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Jana Heves <jsvarova> | ||||
| Component: | doc-Resource_Management_Guide | Assignee: | Marie Hornickova <mdolezel> | ||||
| Status: | CLOSED CURRENTRELEASE | QA Contact: | |||||
| Severity: | high | Docs Contact: | |||||
| Priority: | urgent | ||||||
| Version: | 7.3 | CC: | jinli.li, lnykryn, matthias, qe-baseos-daemons, rhel-docs, systemd-maint-list, systemd-maint | ||||
| Target Milestone: | rc | Keywords: | Documentation | ||||
| Target Release: | --- | ||||||
| Hardware: | x86_64 | ||||||
| OS: | Linux | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | Doc Type: | Bug Fix | |||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | 1172890 | Environment: | |||||
| Last Closed: | 2016-11-11 13:34:30 UTC | Type: | Bug | ||||
| Regression: | --- | Mount Type: | --- | ||||
| Documentation: | --- | CRM: | |||||
| Verified Versions: | Category: | --- | |||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||
| Bug Depends On: | 1172890 | ||||||
| Bug Blocks: | |||||||
| Attachments: |
|
||||||
|
Comment 1
Jana Heves
2016-04-14 09:06:46 UTC
Dear Lukáš, Based on your comment in bug 1172890 [1], I've gone ahead and commented out the reference to "ControlGroupAttribute=" and the example on "Changing Low-level Cgroup Attributes" [2] in the Resource Management Guide [3]. May I ask you what the substitute directive that can be used in the unit file to facilitate resource management is? Is it the swappiness parameter? After a short investigation, the best idea to me seems to provide an example similar to this [4], instructing the user to set vm.swappiness = 10. Please let me know what you think. Thank you very much for your help! jana [1] https://bugzilla.redhat.com/show_bug.cgi?id=1172890#c2 [2] commit https://gitlab.cee.redhat.com/red-hat-enterprise-linux-documentation/doc-Red_Hat_Enterprise_Linux-7-Resource_Management_Guide/commit/46f2e47cf0e20ef7e838cd3eaa7bf9ae6e7fa9b0 [3] https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html-single/Resource_Management_Guide/index.html#sec-Modifying_Unit_Files [4] https://en.wikipedia.org/wiki/Swappiness Every supported cgroup attribute that could be set directly through unit-files is documented in man page systemd.resource-control. For the rest (like the swappiness) there is currently no way how to do it directly through systemd. The reason behind this is the new (still unfinished) cgroup interface in kernel. We don't want to support anything, that would be removed when we move systemd to the new cgroup hierarchy. As a workaround you should be able to do something like: ExecStartPost=/bin/bash -c "echo 70 > sys/fs/cgroup/memory/system.slice/testdd.service/memory.swappiness" I'm the initial reporter (thanks, Jana, for having filed this properly!). Indeed as Lukáš has pointed out, there is no immediate replacement. In my particular case I'm stuck since I wanted to set the memory.memsw.limit_in_bytes to the same value as the MemoryLimit= in order to prevent any swap usage, but for a user slice, not a service. And the ExecStartPost= isn't valid for a slice. In any case, I would be fine with the documentation just mentioning an ExecStartPost= for now, as services are the most common units on which people want to set cgroup attributes. Created attachment 1147632 [details]
a documentation excerpt; section 2.3.2. Modifying Unit Files
Dear Lukáš and Matthias, Thank you very much for your explanations. I've added one new paragraph and an example to the guide based on your recommendations [1]. May I kindly ask you for a review? As Matthias does not have the access to our internal preview tool [2], I've attached an excerpt of the section in comment 5. Thank you very much for your cooperation, jana [1] https://gitlab.cee.redhat.com/red-hat-enterprise-linux-documentation/doc-Red_Hat_Enterprise_Linux-7-Resource_Management_Guide/commit/54bfa4858cef2c9f2508327f4d3ed404cf08b858 [2] http://jenkinscat.gsslab.pnq.redhat.com:8080/view/RHEL7/job/doc-Red_Hat_Enterprise_Linux-7-Resource_Management_Guide%20%28html-single%29/lastSuccessfulBuild/artifact/tmp/en-US/html-single/index.html#sec-Modifying_Unit_Files I'm not authorized to see the attachment, even when logged in, weird... Anyway, I trust you to get a proper update/fix since the issue is clearly understood :-) From Lukáš's email feedback : --- Maybe I would explictly mention that systemd currently support only subset of cgroup features and that the ExecStartPost is a workaround for that. Also there is a missing slash sys/fs/cgroup/memory/system.slice/testdd.service/memory.swappiness should be /sys/fs/cgroup/memory/system.slice/testdd.service/memory.swappiness --- Created attachment 1165676 [details]
screenshot for the final docs version
2.3.2. Modifying Unit Files: Managing Other System Resources
Thank you both, Lukas and Matthias, for your assistance! The final changes are provided in commits [1] and [2] and in the screenshot above. jana [1] https://gitlab.cee.redhat.com/red-hat-enterprise-linux-documentation/doc-Red_Hat_Enterprise_Linux-7-Resource_Management_Guide/commit/81ee7a5dc77766490f5f1db50be0bbd290b980be [2] https://gitlab.cee.redhat.com/red-hat-enterprise-linux-documentation/doc-Red_Hat_Enterprise_Linux-7-Resource_Management_Guide/commit/d52b92a8fba1901575283c5903a5a357709aac58 With Matthias Saou's final testing and suggestions, I've made final changes to section 2.3.2. Modifying Unit Files: https://gitlab.cee.redhat.com/red-hat-enterprise-linux-documentation/doc-Red_Hat_Enterprise_Linux-7-Resource_Management_Guide/commit/f3d0b13f1caf4ab884d98b9a276f318e16defc52 The change will appear on the RH Customer Portal with the 7.3 Beta release of the book. Closing this bug as verified. |