[aklug] Re: Phoronix recently published an article regarding a ~200 lines Linux Kernel patch

From: Kevin Miller <atftb2@alaska.net>
Date: Sat Nov 20 2010 - 10:18:02 AKST

On 11/19/2010 09:41 PM, Jim Gribbin wrote:
> Maybe I don't know how to use pastebin, but the link you posted doesn't seem to work.
>
> It starts to load that raw.php?[etc], then drops back to pastebin.com/index.html

Odd. It's short,so here's the output below. Hope the OP doesn't mind
it posted to the list:

===============================================================
Start by editing your rc.local file, running sudo gedit /etc/rc.local
and add the following lines 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

Save and exit gedit. Now, make it executable:

sudo chmod +x /etc/rc.local

After doing this, edit the .bashrc file found in your home directory
(gedit ~/.bashrc) and, at the end of this file, 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

One last thing. To make sure that cgroups are deleted whenever the last
task leaves, run:

sudo gedit /usr/local/sbin/cgroup_clean

And copy-paste this:

#!/bin/sh
rmdir /dev/cgroup/cpu/$*

Once again, save the file, exit gedit and make it executable:

sudo chmod +x /usr/local/sbin/cgroup_clean

Done! Restart your computer to apply the changes.
===============================================================

-- 
Kevin Miller - http://www.alaska.net/~atftb
Juneau, Alaska
In a recent survey, 7 out of 10 hard drives preferred Linux
Registered Linux User No: 307357, http://counter.li.org
---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.
Received on Sat Nov 20 10:17:57 2010

This archive was generated by hypermail 2.1.8 : Sat Nov 20 2010 - 10:17:58 AKST