RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1327082 - the cgroup parameter ‘ControlGroupAttribute’ doesn’t work
Summary: the cgroup parameter ‘ControlGroupAttribute’ doesn’t work
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: doc-Resource_Management_Guide
Version: 7.3
Hardware: x86_64
OS: Linux
urgent
high
Target Milestone: rc
: ---
Assignee: Marie Hornickova
QA Contact:
URL:
Whiteboard:
Depends On: 1172890
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-04-14 09:04 UTC by Jana Heves
Modified: 2019-03-06 01:10 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of: 1172890
Environment:
Last Closed: 2016-11-11 13:34:30 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
screenshot for the final docs version (93.25 KB, application/pdf)
2016-06-07 14:28 UTC, Jana Heves
no flags Details

Comment 1 Jana Heves 2016-04-14 09:06:46 UTC
Based on customer's request, copy-past of an email addressed to jheves, April 13

Hi Jana,

I'm sending this to you since you have made the latest update...

I was using the latest "Resource Management Guide" 0.0-1.6, and at the
end of section 2.3.2 about "Modifying Unit Files" it gives an example
for "ControlGroupAttribute=". Unfortunately this has been removed from
systemd some time ago and does not work in RHEL 7.2.

It seems like it might have never worked in RHEL7 at all!

https://bugzilla.redhat.com/show_bug.cgi?id=1172890

It would be worth fixing the documentation for RHEL 7.3 :-)

Cheers,
Matthias

Comment 2 Jana Heves 2016-04-14 09:55:10 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

Comment 3 Lukáš Nykrýn 2016-04-14 10:24:55 UTC
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"

Comment 4 Matthias Saou 2016-04-14 11:05:01 UTC
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.

Comment 5 Jana Heves 2016-04-15 12:31:53 UTC
Created attachment 1147632 [details]
a documentation excerpt; section 2.3.2. Modifying Unit Files

Comment 6 Jana Heves 2016-04-15 12:38:00 UTC
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

Comment 7 Matthias Saou 2016-05-23 09:45:58 UTC
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
---

Comment 8 Jana Heves 2016-06-07 14:28:35 UTC
Created attachment 1165676 [details]
screenshot for the final docs version

 ⁠2.3.2. Modifying Unit Files: ⁠Managing Other System Resources

Comment 10 Jana Heves 2016-06-08 09:57:35 UTC
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.


Note You need to log in before you can comment on or make changes to this bug.