assigning all users to a given cpuset


I have a server with 64 cores and I plan to devote only a few of them to interactive users, leaving the other cores to background processes.
I think the solution is to setup cpusets and I played with them successfully, but I don’t know how to “lock” users (each time they logs in) to a given cpuset.

mkdir /dev/cpuset
mount -t cpuset none /dev/cpuset
mkdir /dev/cpuset/my_cpuset
echo “5,6” > /dev/cpuset/my_cpuset/cups

I can assign already existing processes to my_cpuset
echo “23223” > /dev/cpuset/my_cpuset/tasks
(where 23223 is the pid of the existing process)

but how can I arrange things so that all login will automatically belong to my_cpuset ?
does yast2 help in any way?

Thank you for your help,

Silly idea…

/etc/crontab entry:

          • root /root/bin/

In the script have it find all shell processes (bash) for non-root users
and then assign them over to /dev/cpuset/my_cpuset/tasks, perhaps first
after verifying that the PID is not already in that pseudo-file (assuming
that even matters).

There may be a better way, though…

Good luck.