#14 La noticia se supone que es el que alguien haya hecho algo similar en 4 líneas en BASH. Lo de la discusión es un tema a parte creo yo. Pero bueno, para todo propósito, sea el que sea, siempre hay excusa.
y #5 si, justamente Linus comenta lo mismo pero de forma menos poética que tú
Anyway, I find it depressing that now that this is solved, people come
out of the woodwork and say "hey you could do this". Where were you
guys a year ago or more?
Tough. I found out that I can solve it using cgroups, I asked people
to comment and help, and I think the kernel approach is wonderful and way simpler than the scripts I've seen. Yes, I'm biased ("kernels
are easy - user space maintenance is a big pain").
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