Linux CPU sets (cpusets) limit the CPUs and memory nodes on which a group of tasks may run or allocate memory. They define a placement boundary—not a CPU-time quota—and are managed through the host’s cgroup hierarchy.
What a CPU set does
A cpuset is a Linux kernel mechanism for constraining the CPU cores and NUMA memory nodes available to a process or group of processes. Each task belongs to a cpuset. Child groups can use only resources allowed by their parent, and a task’s children inherit its cpuset association unless they are moved elsewhere.
This is a placement rule. It restricts where work can run and where memory can be allocated; it does not, by itself, cap how much CPU time the tasks may consume. The Linux kernel cpuset documentation describes the mechanism and its hierarchy.
CPU sets, affinity, and CPU quotas
| Mechanism | What it controls | How it relates to a cpuset |
|---|---|---|
| CPU set | The CPUs and memory nodes available to tasks in a cgroup. | Defines the placement boundary enforced by the kernel. |
| CPU affinity | The CPUs a task is permitted or prefers to run on. | Per-task affinity requests, such as sched_setaffinity, are filtered through the cpuset. Affinity cannot grant access to CPUs outside that boundary. |
| CPU bandwidth control | CPU time or a task group’s share of CPU time under contention. | Complements cpusets: a cpuset selects locations, while bandwidth controls regulate time or proportion. |
Memory policy requests such as mbind and set_mempolicy are also subject to the task’s cpuset. A CPU selection alone does not guarantee NUMA-local memory placement; configure the memory-node list as well when that alignment matters. The cpuset(7) manual page describes the interface as a way to control processor and memory placement.
#1 Best Overall
How cgroup v1 and v2 differ
The cpuset concept is available through both cgroup v1 and cgroup v2, but the hierarchy and interface differ. Legacy v1 commonly exposes files such as cpuset.cpus, cpuset.mems, cpuset.cpu_exclusive, and cpuset.memory_migrate in a cpuset hierarchy. The v2 controller retains CPU and memory-node placement while adding effective-resource reporting and partition features.
| Interface | CPU and memory-node values | Important distinction |
|---|---|---|
| cgroup v1 | Includes cpuset.cpus and cpuset.mems. |
Uses a separate cpuset hierarchy and legacy interface files. |
| cgroup v2 | Includes cpuset.cpus, cpuset.cpus.effective, cpuset.mems, and cpuset.mems.effective. |
The requested list and the effective list are distinct; v2 also supports partition features. |
In v2, cpuset.cpus is the requested CPU list. cpuset.cpus.effective reports the CPUs actually available after parent restrictions and CPU hotplug effects. The same requested-versus-effective distinction applies to memory nodes. A child cannot request CPUs or memory nodes that its parent does not permit. See the Linux kernel cgroup v2 documentation for controller behavior.
Why the effective list may be smaller
If cpuset.cpus.effective contains fewer CPUs than the list requested in cpuset.cpus, the request is constrained by available resources. A parent may expose only a subset of those CPUs, or CPU hotplug may have made some CPUs unavailable. Check the effective memory-node list for the same kind of mismatch when configuring NUMA placement.
The effective files show what the cgroup can actually use; they do not mean the kernel ignored the hierarchy. Confirm the parent’s allowed resources and the host’s online CPU state before relying on the requested list.
Free tools Windows power users keep installed
One-click scans. No signup required.
When CPU sets are useful
NUMA-aware workloads
On large NUMA systems, keeping a workload’s CPUs and memory nodes aligned can reduce cross-node memory traffic and contention. Set both CPU and memory-node lists when the workload depends on that placement.
Hierarchical resource organization
Administrators can give a service class a broad resource set and subdivide it among workloads. Child groups remain bounded by their parent, making the hierarchy useful for organizing placement policies.
Rank #4
Exclusive placement and partitions
Exclusive CPU settings or cgroup v2 partition features can establish non-overlapping scheduling domains when isolation is needed. These settings remain subject to parent and sibling rules; they do not let a child claim resources outside its allowed hierarchy.
Before changing a cpuset
- Identify whether the host uses a legacy cgroup v1 hierarchy or unified cgroup v2, and verify that the cpuset controller is available, enabled, and delegated to the relevant manager.
- Inspect the parent’s allowed CPUs and memory nodes. Any child request must be a subset of those resources.
- For NUMA-sensitive work, configure the memory-node list as well as the CPU list.
- After configuration, inspect
cpuset.cpus.effectiveandcpuset.mems.effectivewhere available, particularly if the host has restrictive ancestors or CPU hotplug. - Use the host’s service manager or container runtime conventions to place processes in a cgroup. Do not assume it is safe to alter a manually created group beneath an orchestrator.
- For Kubernetes workloads, verify the node’s cgroup mode and runtime configuration. Kubelet and the container runtime use cgroups to manage pod and container resources.
What to know about system integration
On modern Linux systems, cpusets are generally exposed through a cgroup hierarchy rather than treated as a standalone filesystem that an operator should mount and edit independently. The cpuset(7) manual page notes that the legacy cpuset pseudo-filesystem is commonly mounted at /dev/cpuset; the correct interface on a particular host depends on its cgroup version and management stack.
Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Clear out junk files and repair common Windows errors3Fix the driver behind crashes, sound loss and screen glitchesBest Value
Systemd, container runtimes, and Kubernetes may own or delegate parts of that hierarchy. Follow the system’s manager rather than writing directly to files that an orchestrator controls. The exact configuration path therefore depends on the host’s cgroup mode and delegation setup.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




