Getting the alternative to the 200-Line Linux Kernel patch to work
- by Gödel
Apparently, there is a comparable alternative to the 200-line kernel patch
that involves no kernel upgrade.
It is presented here and discussed here.
However, I am not sure if webupd8's solution (under the
section "Use it in Ubuntu") on Ubuntu actually works or not. In particular, one
commenter on ./ is saying he's getting an error message. Could anyone
post the "correct" method that actually works?
Suggested solution:
Based on the comments I've read so far, the following seems to work.
(1) In /etc/rc.local, add the following lines to above exit 0:
mkdir -p /dev/cgroup/cpu
mount -t cgroup cgroup /dev/cgroup/cpu -o cpu
mkdir -m 0777 /dev/cgroup/cpu/user
echo "/usr/local/sbin/cgroup_clean" > /dev/cgroup/cpu/release_agent
(2) Create a file named /usr/local/sbin/cgroup_clean with the following content:
#!/bin/sh
rmdir /dev/cgroup/cpu/$1
(3) In your ~/.bashrc, add:
if [ "$PS1" ] ; then
mkdir -m 0700 /dev/cgroup/cpu/user/$$
echo $$ > /dev/cgroup/cpu/user/$$/tasks
echo "1" > /dev/cgroup/cpu/user/$$/notify_on_release
fi
(4) (To make sure the execution bit is on) execute
sudo chmod +x /usr/local/sbin/cgroup_clean /etc/rc.local
(5) Reboot.