DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PC×
Skip to content
World desk4 min

Linux CPU Sets: What They Do and How They Work

Linux cpusets define the CPUs and memory nodes tasks may use. Learn how the hierarchy works, how cgroup v1 and v2 differ, and what effective CPU lists mean.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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.

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

  1. 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.
  2. Inspect the parent’s allowed CPUs and memory nodes. Any child request must be a subset of those resources.
  3. For NUMA-sensitive work, configure the memory-node list as well as the CPU list.
  4. After configuration, inspect cpuset.cpus.effective and cpuset.mems.effective where available, particularly if the host has restrictive ancestors or CPU hotplug.
  5. 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.
  6. 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.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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.

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.