Userspace responsiveness .bashrc alternative (Ubuntu 10.10: Working)

Originally published on eve.gd on 19 November 2010, last updated 6 September 2026.

Read this post on the web (with images, PDF and citation details)

Recent discussion on the lkm has lead to Linus giving the go-ahead to a large kernel patch that massively increases responsiveness when multi-tasking on Linux desktop. A slashdot article today also points out that the same result can be achieved by modifications userspace and that this is, indeed, how the patch was tested.

slashdot article

The original instructions can be found at webupd8, but, for Ubuntu systems, they are incomplete.

webupd8

Here's the correct information.

/etc/rc.local should contain:

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

and should be executable (sudo chmod +x /etc/rc.local).

Your ~/.bashrc should contain:

if [ "$PS1" ] ; then

mkdir -p -m 0700 /dev/cgroup/cpu/user/$$ > /dev/null 2>&1

echo $$ > /dev/cgroup/cpu/user/$$/tasks

echo "1" > /dev/cgroup/cpu/user/$$/notify_on_release

fi

directly at the top.

Finally (and this is where the original instructions were incomplete), /usr/local/sbin/cgroup_clean should contain:

#!/bin/sh

if [ "$1" != "/user" ]; then

rmdir /dev/cgroup/cpu/$1

fi

as suggested by an anonymous comment on the original. Finally, ensure the cgroup cleanup script is executable: sudo chmod +x /usr/local/sbin/cgroup_clean

anonymous comment

Reboot your system and you too can have an ultra-responsive desktop!

ultra-responsive desktop

References

This reference list has been generated, in many cases, through an automated process and may therefore contain errors or incomplete metadata. It is provided purely as assistance for finding the items mentioned within this post.

1. ‘Alternative To The "200 Lines Kernel Patch That Does Wonders" Which You Can Use Right Away’, WebUpd8 <http://www.webupd8.org/2010/11/alternative-to-200-lines-kernel-patch.html>

2. ‘Alternative To The "200 Lines Kernel Patch That Does Wonders" Which You Can Use Right Away’, WebUpd8 <http://www.webupd8.org/2010/11/alternative-to-200-lines-kernel-patch.html#comment-99182030>

3. Slashdot article on Linux responsiveness userspace patch <http://slashdot.org/story/10/11/18/2246213/Alternative-To-the-200-Line-Linux-Kernel-Patch>

4. ‘The ~200 Line Linux Kernel Patch That Does Wonders’, Phoronix <http://www.phoronix.com/scan.php?page=article&item=linux_2637_video&num=2>

http://www.webupd8.org/2010/11/alternative-to-200-lines-kernel-patch.html
http://www.webupd8.org/2010/11/alternative-to-200-lines-kernel-patch.html#comment-99182030
http://slashdot.org/story/10/11/18/2246213/Alternative-To-the-200-Line-Linux-Kernel-Patch
http://www.phoronix.com/scan.php?page=article&item=linux_2637_video&num=2