# assigning all users to a given cpuset

**URL:** <https://forums.suse.com/t/assigning-all-users-to-a-given-cpuset/23425>\
**Category:** SLES Configure-Administer\
**Created:** [December 18, 2012, 4:46pm UTC](https://forums.suse.com/t/assigning-all-users-to-a-given-cpuset/23425 "2012-12-18T16:46:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![emanuele\_lombardi](https://avatars.discourse-cdn.com/v4/letter/e/f04885/32.png) [@emanuele\_lombardi](https://forums.suse.com/u/emanuele_lombardi)\
**Post date:** [December 18, 2012, 4:46pm UTC](https://forums.suse.com/t/assigning-all-users-to-a-given-cpuset/23425/1 "2012-12-18T16:46:26Z")

</div>

Hi,

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,  
Emanuele

---

<div class="post-metadata">

**Author:** ![ab1](https://avatars.discourse-cdn.com/v4/letter/a/d2c977/32.png) [@ab1](https://forums.suse.com/u/ab1)\
**Post date:** [December 18, 2012, 5:24pm UTC](https://forums.suse.com/t/assigning-all-users-to-a-given-cpuset/23425/2 "2012-12-18T17:24:11Z")

</div>

Silly idea…

/etc/crontab entry:

- 
  - 
    - 
      - 
        - root /root/bin/cpuset-assigner.sh

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.
