Bug 54753

Summary: Cannot configure cpu control group hierarchies via logind.conf
Product: systemd Reporter: philipp.reinkemeier
Component: generalAssignee: systemd-bugs
Status: RESOLVED FIXED QA Contact: systemd-bugs
Severity: normal    
Priority: medium CC: cjg9411, maxposedon
Version: unspecified   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description philipp.reinkemeier 2012-09-11 06:21:49 UTC
I tried to configure cpu controller for each user logging in, in order to even out CPU usage. I am aware that such things can be done using systemd's pam module with the "controllers=" option. However, that pam module is included in multiple other pam files. So i searched for a more centralized place where i could configure it and stumbled upon logind.conf. Its man page talks about an option "Controllers=", which seems to have the same effect like the corresponding option of the pam module. However, "Controllers=cpu" has no effect. Looking at "/sys/fs/cgroups/cpu", i do not see any hierarchy with my username (which exists when configuring controllers via the pam module option).
Comment 1 Maksim Melnikau 2012-11-18 15:00:51 UTC
In fact only *cpu* control group can not be configured with logind.conf.

/etc/systemd/system.conf
[Manager]
DefaultControllers=cpu memory blkio
JoinControllers=cpu,cpuacct,cpuset net_cls,net_prio

/etc/systemd/logind.conf
[Login]
Controllers=cpu memory blkio
ResetControllers=

# login to system
# cat /proc/self/cgroup 
8:perf_event:/
7:blkio:/user/max_posedon/c1
6:net_prio,net_cls:/
5:freezer:/
4:devices:/
3:memory:/user/max_posedon/c1
2:cpuacct,cpu,cpuset:/
1:name=systemd:/user/max_posedon/c1

As I see, it works with memory, and blkio, and don't with cpu.
Comment 2 Maksim Melnikau 2012-11-18 15:02:03 UTC
# systemctl --version
systemd 195
gentoo
+PAM +LIBWRAP -AUDIT -SELINUX +IMA -SYSVINIT -LIBCRYPTSETUP +GCRYPT +ACL +XZ
Comment 3 Maksim Melnikau 2013-03-26 16:26:11 UTC
I found, that created /cpu/user/<user> hierarchy completely not used. E.g. smth created it, but don't push there any tasks.

m_melnikau-M11xR3 cgroup # cat ./systemd/user/max_posedon/1/tasks | wc -l
297
m_melnikau-M11xR3 cgroup # cat ./memory/user/max_posedon/1/tasks  | wc -l
297
m_melnikau-M11xR3 cgroup # cat ./cpu/user/max_posedon/1/tasks  | wc -l
0
Comment 4 philipp.reinkemeier 2013-05-16 06:35:45 UTC
Now that i tried again with systemd-204 it works for me with by setting "Controllers=cpu" and "ResetControllers=".

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.