Product SiteDocumentation Site

2.7. Setting Parameters

Set subsystem parameters by running the cgset command from a user account with permission to modify the relevant control group. For example, if /cgroup/cpuset/group1 exists, specify the CPUs to which this group has access with the following command:
cgset -r cpuset.cpus=0-1 group1
The syntax for cgset is: cgset -r parameter=value path_to_cgroup , where:
The values that you can set with cgset might depend on values set higher in a particular hierarchy. For example, if group1 is limited to use only CPU 0 on a system, you cannot set group1/subgroup1 to use CPUs 0 and 1, or to use only CPU 1.
You can also use cgset to copy the parameters of one cgroup into another, existing cgroup. For example:
cgset --copy-from group1/ group2/
The syntax to copy parameters with cgset is: cgset --copy-from path_to_source_cgroup path_to_target_cgroup , where:
Ensure that any mandatory parameters for the various subsystems are set before you copy parameters from one group to another, or the command will fail.

Alternative method

To set parameters in a control group directly, insert values into the relevant subsystem pseudofile using the echo command. For example, this command inserts the value 0-1 into the cpuset.cpus pseudofile of the control group group1:
echo 0-1 > /cgroup/cpuset/group1/cpuset.cpus
With this value in place, the tasks in this control group are restricted to CPUs 0 and 1 on the system.