A Redhat engineer post a mail about achieving the same result with only userspace code :
Quote:
Here's my super-complex patch btw, to achieve exactly the same thing
from userspace without involving any kernel or systemd patching and
kernel-side logic. Simply edit your own ~/.bashrc and add this to the end:
if [ "$PS1" ] ; then
mkdir -m 0700 /sys/fs/cgroup/cpu/user/$$
echo $$ > /sys/fs/cgroup/cpu/user/$$/tasks
fi
Then, as the superuser do this:
mount -t cgroup cgroup /sys/fs/cgroup/cpu -o cpu
mkdir -m 0777 /sys/fs/cgroup/cpu/user
Done. Same effect. However: not crazy.
|
http://lkml.org/lkml/2010/11/16/330
Linus Torvald disagree, basically because he doubt that normal users will take time to tweak their shell, and argued that, by including the patch in the kernel, everybody will benefit from it.
Interesting thread.