CSET-PROC(1)

πŸ’– CSET-PROC πŸ’–

okay bestie, welcome to the cset-proc page of the manual (yes it lives in section 1, it's that girl). sit down, hydrate, we're learning how to manage processes running in cpusets and honestly? it's giving powerful. πŸ¦‹


✨ NAME ✨

cset-proc β€” manage processes running in cpusets πŸ‘‘


πŸŽ€ SYNOPSIS πŸŽ€

cset [cset options] proc [proc options] [args]
cset proc --help
cset proc
cset proc my_set my_other_set
cset proc --list --set my_set
cset proc --exec my_set /opt/software/my_code --my_opt_1
cset proc --set my_set --exec /opt/software/my_code --my_opt_1
cset proc --move 2442,3000-3200 my_set
cset proc --move --pid=2442,3000-3200 --toset=my_set
cset proc --move --fromset=my_set_1 --toset=my_set_2
cset proc --move --pid=42 --fromset=/group1/myset --toset=/group2/yourset

πŸ’… OPTIONS πŸ’…

  • -h, --help β€” prints the list of options for this command. the girl tells you about herself. self-aware queen.
  • -l, --list β€” list processes in the specified cpuset. showing off who's in the group chat.
  • -e, --exec β€” execute arguments in the specified cpuset. run that program, but in that set.
  • -u USER, --user=USER β€” use this USER to --exec (id or name). you can hand it an id or a name, flexible fr fr.
  • -g GROUP, --group=GROUP β€” use this GROUP to --exec (id or name). same energy, but group edition.
  • -m, --move β€” move specified tasks to specified cpuset. to move a PIDSPEC to a cpuset, use -m PIDSPEC cpuset; to move all tasks specify --fromset and --toset.
  • -p PIDSPEC, --pid=PIDSPEC β€” specify pid or tid specification. this is where you say who.
  • --threads β€” if specified, any processes found in the PIDSPEC to have multiple threads will automatically have all their threads added to the PIDSPEC (use to move all related threads to a cpuset). basically it collects the whole friend group. 🫢
  • -s CPUSET, --set=CPUSET β€” specify name of immediate cpuset.
  • -t TOSET, --toset=TOSET β€” specify name of destination cpuset. where we're going πŸ’«
  • -f FROMSET, --fromset=FROMSET β€” specify name of origination cpuset. where we came from 🏠
  • -k, --kthread β€” move, or include moving, unbound kernel threads. careful with this one, more below.
  • --force β€” force all processes and threads to be moved. highkey the scary one, scroll down bestie.
  • -v, --verbose β€” prints more detailed output, additive. it stacks, so add more vs for more yapping.

🌸 DESCRIPTION 🌸

So, cset proc is the command you use to run and manage arbitrary processes on specified cpusets. It's also the one you call to move pre-existing processes and threads to specified cpusets. And heads up β€” you might notice there's no "kill" or "destroy" option. Not a bug, not an oversight, it's just not that kind of girl. Use the standard OS ^C or kill commands for that. πŸ’€

To list which tasks are running in a particular cpuset, use the --list command.

For example:

# cset proc --list --set myset

This command will list all the tasks running in the cpuset called "myset". simple as that.


πŸ¦‹ making new processes

Processes are created by specifying the path to the executable and specifying the cpuset that the process is to be created in.

For example:

# cset proc --set=blazing_cpuset --exec /usr/bin/fast_code

This command will execute the /usr/bin/fast_code program on the "blazing_cpuset" cpuset. πŸ”₯

Note that if your command takes options, then use the traditional -- marker to separate cset's options from your command's options.

For example:

# cset proc --set myset --exec β€” ls -l

This command will execute "ls -l" on the cpuset called "myset".


🌈 the PIDSPEC situation

The PIDSPEC argument taken for the move command is a comma separated list of PIDs or TIDs. The list can also include brackets of PIDs or TIDs (i.e. tasks) that are inclusive of the endpoints.

For example:

    1,2,5         Means processes 1, 2 and 5
    1,2,600-700   Means processes 1, 2 and from 600 to 700
Note The range of PIDs or TIDs does not need to have every position populated. In other words, for the example above, if there is only one process, say PID 57, in the range of 50-65, then only that process will be moved. no need to fill every seat at the table bestie πŸ“

To move a PIDSPEC to a specific cpuset, you can either specify the PIDSPEC with --pid and the destination cpuset with --toset, or use the short hand and list the cpuset name after the PIDSPEC for the --move arguments.

The move command accepts multiple common calling methods. For example, the following commands are equivalent:

# cset proc --move 2442,3000-3200 reserved_set

# cset proc --move --pid=2442,3000-3200 --toset=reserved_set

These commands move the tasks defined as 2442 and any running task between 3000 and 3200 inclusive of the ends to the cpuset called "reserved_set".

Specifying the --fromset is not necessary since the tasks will be moved to the destination cpuset no matter which cpuset they are currently running on.

Note However, if you do specify a cpuset with the --fromset option, then only those tasks that are both in the PIDSPEC and are running in the cpuset specified by --fromset will be moved. I.e., if there is a task running on the system but not in --fromset that is in PIDSPEC, it will not be moved. strict queen, she only takes the ones who match πŸ’…

✨ the --threads switch

If the --threads switch is used, then the proc command will gather any threads of belonging to any processes or threads that are specified in the PIDSPEC and move them. This provides an easy way to move all related threads: just pick one TID from the set and use the --threads option. one TID and the whole squad comes along 🫢


πŸ‘‘ moving ALL the userspace tasks

To move all userspace tasks from one cpuset to another, you need to specify the source and destination cpuset by name.

For example:

# cset proc --move --fromset=comp1 --toset=comp42

This command specifies that all processes and threads running on cpuset "comp1" be moved to cpuset "comp42".

Note This move command will not move kernel threads unless the -k/--kthread switch is specified. If it is, then all unbound kernel threads will be added to the move. Unbound kernel threads are those that can run on any CPU. If you also specify the --force switch, then all tasks, kernel or not, bound or not, will be moved.
Caution Please be cautious with the --force switch, since moving a kernel thread that is bound to a specific CPU to a cpuset that does not include that CPU can cause a system hang. 😭 like, actually. system hang. not a vibe. respect the --force.

πŸ’œ unique names, full paths, and the tree

You must specify unique cpuset names for the both exec and move commands. If a simple name passed to the --fromset, --toset and --set parameters is unique on the system then that command executes. However, if there are multiple cpusets by that name, then you will need to specify which one you mean with a full path rooted at the base cpuset tree.

For example, suppose you have the following cpuset tree:

    /cpusets
      /group1
        /myset
        /yourset
      /group2
        /myset
        /yourset

Then, to move a process from myset in group1 to yourset in group2, you would have to issue the following command:

# cset proc --move --pid=50 --fromset=/group1/myset
--toset=/group2/yourset

You do not have to worry about where in the Linux filesystem the cpuset filesystem is mounted. The cset command takes care of that. Any cpusets that are specified by path (such as above), are done with respect to the root of the cpuset filesystem. she handles the logistics, you just show up πŸ’«


πŸŽ€ LICENSE πŸŽ€

Cpuset is licensed under the GNU GPL V2 only. periodt.


Copyright (c) 2008-2011 Novell Inc.


🌟 AUTHOR 🌟

Written by Alex Tsariounov <tsariounov@gmail.com>. iconic behavior tbh.


πŸ¦‹ SEE ALSO πŸ¦‹


✨ AUTHOR ✨

Alex Tsariounov <tsariounov@gmail.com> Author.


okay bestie that's the whole page 🫢 this manual was brought to you by version 1.5.8, dated March 2016, and by the fact that even kernel schedulers deserve a little main character energy. go move some tasks. slay. πŸ’–βœ¨πŸŽ€