[PATCH] automatically create a subcgroup in the cpu hierarchy for each widget
@poettering
Submitted by Lennart Poettering Link to original bug (#635119)
Description
Created attachment 174724 the patch
As a follow-up about the recent discussion on LKML, Phoronix, Slashdot and friends regarding tty-based CPU autogrouping here's a patch that does the same in userspace. It's pretty minimal but does what is necessary.
Note that for this to work you need the cpu cgroup hierarchy mounted to /sys/fs/cgroup/cpu. systemd systems have that mounted anyway, for others you might need to do this manually. Also, your access to the cgroup fs must be set properly so that normal users can create subgroups of the cgroups their processes run it. systemd sets this up properly out-of-the-box now, on other machines might need to do this manually. On a non-systemd system do the following:
mount -t tmpfs tmpfs /sys/fs/cgroup mkdir /sys/fs/cgroup/cpu mount -t cgroup cgroup /sys/fs/cgroup/cpu -o cpu chmod 777 /sys/fs/cgroup/cpu
(Of course, the last line is dangerous, this needs to managed properly, which systemd does. But for a preview on non-F15 systems the lines above should suffice)
Patch 174724, "the patch":
cpu-cgroup.patch
Resolution: RESOLVED OBSOLETE