Fact-checked by Grok 2 weeks ago

Processor affinity

Processor affinity, also known as CPU affinity or CPU pinning, is a technique in operating systems that enables the binding of a or to one or more specific (CPU) cores or processors within a multiprocessor or multicore system, thereby restricting the operating system scheduler from migrating it to other cores. This approach optimizes performance by maintaining data locality in processor s and minimizing the overhead of context switches and cache reloads that occur when processes migrate between processors. The primary benefits of processor affinity arise in environments with (NUMA) architectures, where memory access times vary based on proximity to the ; binding processes to specific cores reduces remote memory access penalties and cache misses, leading to improved throughput and reduced latency in applications. In (SMP) systems, careful affinity settings can enhance by aligning process communications with processor topologies, avoiding inter-socket overhead. Additionally, it supports and time-sensitive workloads by isolating critical threads on dedicated processors, ensuring predictable execution and minimizing contention for shared resources. Processor affinity can be implemented as soft affinity, where the scheduler prefers to keep a on its current but allows for load balancing, or hard affinity, which enforces strict to prevent any . In , this is achieved through system calls like sched_setaffinity and sched_getaffinity, which use a bitmask to specify allowable processors, a feature introduced in kernel version 2.5. Modern frameworks, such as Slurm and , provide options like --cpu-bind and OMP_PROC_BIND to automate settings across nodes, ensuring even distribution of processes and threads to leverage topologies effectively. While widely adopted for gains in scientific simulations and applications, improper can lead to uneven utilization or wear, highlighting the need for balanced configurations.

Fundamentals

Definition and Purpose

Processor affinity refers to the capability of an operating system to bind a process or thread to a specific subset of processors, such as central processing units (CPUs) or cores, within a multiprocessor system. This binding restricts the scheduler from migrating the process to unauthorized processors, ensuring it executes only on the designated ones. The mechanism typically employs an affinity mask, a bitmask representation where each bit corresponds to a processor in the system; set bits indicate permitted processors, while unset bits denote exclusion. For instance, in a system with eight processors, a mask of 0x03 (binary 00000011) would allow execution only on the first two processors. The primary purposes of processor affinity include enforcing data locality to minimize cache migrations and context switches. In multiprocessor environments, frequent process migration across processors can invalidate cache contents on the original processor and require reloading into the new one's , incurring significant performance penalties due to misses and the overhead of saving and restoring states. By maintaining affinity, the operating preserves warm-up benefits, where repeatedly accessed remains in the local processor's , thereby reducing and improving overall throughput. This is particularly relevant in shared-memory s where protocols add further costs to migrations. Processor affinity also supports targeted resource allocation, enabling the dedication of specific processors to critical or high-priority tasks to isolate them from general workloads and prevent . Furthermore, it enhances predictability in systems by constraining execution locations, which helps bound response times and meet deadlines in environments where timing guarantees are essential, such as or applications. This concept originated in symmetric multiprocessing (SMP) systems during the late 1980s and early 1990s, emerging to mitigate scheduling inefficiencies in pioneering multi-CPU hardware like Computer Systems' series, which provided scalable shared-memory architectures starting in 1987. Early implementations addressed the challenges of balancing load while preserving performance in these nascent multiprocessor setups, where uniform access to shared resources amplified the need for affinity-based controls.

Affinity Mechanisms

Processor affinity is typically represented using an affinity mask, a binary bitmask in which each bit corresponds to a specific processor in the system, with a value of 1 indicating that the processor is eligible for scheduling the associated thread or process. For example, a mask value of 0x3 (binary 11) binds a thread to the first two processors (bits 0 and 1 set), while 0x1 restricts it to only the first processor. This structure allows precise control over processor selection, enabling mechanisms that enhance cache locality by minimizing thread migration across processors. Operations on masks commonly employ bitwise logic to combine or refine bindings across multiple threads or processes. The bitwise AND operation computes the of two masks, identifying allowable to both; for instance, ANDing 0x3 ( 0-1) and 0x5 ( 0 and 2) yields 0x1 (only 0). Conversely, the bitwise OR operation forms the , expanding allowable ; ORing the same masks results in 0x7 ( 0-2). These operations facilitate efficient management of group affinities without enumerating individual . The of a or to specific processors begins with querying the system's available processors to determine the total count and construct an appropriate . The is then applied to the target entity via a , which updates the scheduling attributes in the . Upon , child processes inherit the parent's affinity , ensuring consistent processor restrictions across process hierarchies unless explicitly modified. Enforcement of the affinity mask occurs within the kernel scheduler, which restricts scheduling decisions to only those processors indicated by set bits in the mask, thereby preventing involuntary thread migration to unauthorized processors. When selecting a processor for execution, the scheduler checks the mask and excludes ineligible options from consideration. If all processors in the mask are currently overloaded or unavailable, the thread is placed in a run queue and awaits a slot on one of the permitted processors, maintaining strict adherence to the binding without fallback to others.

Benefits and Limitations

Performance Advantages

Processor affinity enhances efficiency by promoting data locality, allowing threads to reuse data in lower-level caches such as L1 and , thereby reducing cache misses in workloads. Studies on shared-memory multiprocessors have demonstrated that cache-affinity scheduling can eliminate a significant portion of misses, achieving reductions of 7-36% across various benchmarks, which translates to overall improvements of 1-10% in execution time. In network-intensive tasks, which often involve processing, full process and affinity has been shown to decrease last-level cache misses by 16-43%, contributing to throughput gains of up to 29%. For numerical scientific simulations, such as multithreaded benchmarks on multi-core systems, CPU affinity strategies improve cache hit ratios by binding threads to specific cores, minimizing and enhancing overall computational efficiency. By limiting thread migrations across processors, reduces the overhead associated with context switching, where the operating system saves and restores thread states, including registers and contents. This minimization of migration costs preserves CPU cycles for productive work, particularly in high-load environments. In database s handling numerous concurrent processes, processor mitigates excessive context switching, leading to higher throughput and lower system overhead compared to unrestricted scheduling. Similarly, in applications, lowers OS scheduling overheads, including those from context switches, resulting in improved cycles per bit and overall packet processing efficiency. Affinity provides greater predictability in execution times for real-time applications by restricting tasks to designated processors, thereby avoiding variability introduced by migrations and . This controlled environment ensures more consistent performance metrics, such as reduced in response times. In real-time scheduling on multiprocessors, arbitrary processor affinities enable of critical tasks, minimizing overheads and supporting schedulability analyses that guarantee deadlines, with structured affinities providing modest schedulability improvements, such as 0-10% higher utilization thresholds compared to partitioned scheduling, over random assignments. For processing, which demands low-latency and stable outputs, affinity combined with cache allocation techniques stabilizes execution cycles, significantly reducing from thousands of cycles to more stable levels in scenarios.

Potential Drawbacks

One significant drawback of processor affinity is its potential to cause load imbalance across processors. By binding threads or processes to specific cores, affinity restricts the operating system's ability to migrate them for even workload distribution, leading to underutilized processors when workloads are uneven. This conflict between affinity and load balancing can exacerbate issues in bursty environments, where sudden spikes in demand overload bound cores while others remain idle, potentially increasing overall system significantly—for instance, from a median of 230 ms to as high as 10 seconds due to queue overflows on busy cores. Managing processor introduces considerable complexity, particularly in dynamic setups like environments. Manual tuning of affinity masks requires careful monitoring to avoid errors that result in resource starvation for unbound tasks or inefficient utilization, as affinity settings can interfere with the scheduler's automatic adjustments and admission controls. Without established runtime metrics for optimal binding, distinguishing between and application threads becomes challenging, complicating efforts to maintain balanced and . Additionally, in datacenter environments, CPU affinity can contribute to uneven hardware wear, with some s aging up to 23 times faster than others due to imbalanced instruction loads on versus application threads, impacting long-term . In systems with few cores, processor affinity often yields minimal performance gains, as the scheduler's inherent load balancing suffices, while the overhead of calls to enforce bindings—such as context switches or validations—can outweigh any locality benefits. This added cost makes less practical for small-scale , where dynamic migration provides adequate efficiency without explicit constraints.

Implementation in Systems

Core Concepts in Multiprocessing

In () environments, processor affinity integrates by allowing processes and threads to be bound to specific CPU cores, optimizing resource utilization in shared-memory systems where all processors have uniform access to memory. This binding is achieved through affinity masks that the scheduler respects, directing task placement to minimize context switches and cache invalidations caused by migrations between CPUs. By constraining execution to designated processors, affinity reduces overhead from inter-CPU data movement, enhancing overall system efficiency in multi-core setups. A key distinction in SMP lies between process-level and thread-level affinity, where threads offer finer-grained compared to processes. At the process level, typically applies a single mask to all threads within the process, binding the entire entity to a set of CPUs for cohesive execution. In contrast, thread enables individual threads to receive unique masks, allowing developers to distribute components across different cores while maintaining integrity, which is particularly useful in parallel applications like scientific simulations. This granularity supports targeted optimizations without altering the broader structure. In SMP systems, particularly single-socket configurations, affinity benefits from improved cache locality remain pronounced as long as uniform memory access is maintained. In multi-socket setups, however, patterns emerge, necessitating -aware strategies for sustained performance.

Handling in NUMA Architectures

In (NUMA) architectures, processor affinity mechanisms are specifically adapted to optimize for memory locality, as access latencies differ markedly between local and remote memory regions. By binding threads or processes to processors within the same NUMA —typically encompassing shared L3 and directly attached memory—affinity reduces the frequency of remote accesses, which can exhibit latencies 2 to 5 times higher than local ones due to inter-node interconnect overhead. This approach ensures that computational workloads remain aligned with the hardware topology, minimizing performance penalties from cross-node data movement. To implement NUMA-aware affinity, traditional CPU bitmasks are extended to node-level identifiers, allowing specifications that target entire groups of processors associated with a node's local resources rather than individual cores. For instance, the tool numactl facilitates node-based binding through options like --cpunodebind=nodes, which restricts process execution to CPUs on designated nodes (e.g., numactl --cpunodebind=0 to bind to node 0), and --membind=nodes to enforce memory allocation from those same nodes. This node-centric masking preserves scheduler flexibility while promoting data and compute colocation, often yielding substantial gains in memory-bound applications by avoiding the constraints and added of remote fetches. Advancements in the , such as those in version 6.11 (released September 2024), have improved handling of sub-NUMA clustering (SNC) in conjunction with Resource Director Technology (RDT), allowing better partitioning of cores, , and for NUMA-optimized workloads. Subsequent developments, including proposals for cgroup-aware NUMA balancing, aim to enhance proactive task and page migrations based on access patterns, with reported performance improvements of up to 30% in specific (HPC) tests on pinned NUMA configurations as of mid-2025. Further enhancements in kernel 6.16 (released October 2025) introduce per-task and per-memory cgroup statistics for NUMA balancing, facilitating better monitoring and dynamic alignment without manual intervention.

Operating System Support

Unix-like Systems

In Unix-like operating systems, processor affinity is implemented through system calls, APIs, and utilities that allow processes or threads to be bound to specific CPUs or processor sets, optimizing performance in multiprocessor environments. Linux provides robust support for processor affinity via the sched_setaffinity(2) system call, which sets the CPU affinity mask of a specified thread (or the calling thread if PID is zero) using a bitmask representing available CPUs. The taskset utility complements this by enabling users to retrieve or modify the affinity of an existing process by PID or to launch new processes with a predefined CPU mask, such as taskset -c 0-3 command to restrict execution to the first four CPUs. For group-level control, the cpuset controller in the cgroup v1 subsystem manages CPU sets hierarchically, integrating with sched_setaffinity(2) to enforce affinity constraints across tasks while respecting parent cgroup limits. Recent Linux kernels (as of 2025) include ongoing improvements in scheduler support for heterogeneous core architectures like big.LITTLE configurations. Solaris and its open-source derivative Illumos offer processor binding through the pbind command, which assigns a or its lightweight processes (LWPs) to a specific ID or set, as in pbind -p <pid> -b <cpu_id>. At the API level, the processor_bind(2) function binds LWPs identified by ID type ( or LWP) to a , returning success or an error code like EBUSY if the is unavailable; this supports both single-CPU binding and, in Solaris 11.2+, multi-CPU affinity via the extended processor_affinity(2) interface. These mechanisms ensure predictable dispatching in Solaris's multiprocessor scheduler. macOS historically used the Task Policy API from the Mach kernel, particularly the thread_policy_set function with THREAD_AFFINITY_POLICY, to hint thread placement on specific CPUs via affinity tags, though these served as scheduler hints rather than strict bindings. However, this API is deprecated on Apple Silicon (ARM-based) systems introduced in 2020, where manual affinity control is no longer supported, and the kernel prioritizes automatic scheduling to optimize for heterogeneous performance and efficiency cores. In IBM's AIX, a POSIX-compliant Unix variant, the bindprocessor command binds or unbinds a process's threads to a specific processor, as in bindprocessor -p <pid> <cpu_id>, or lists available processors with no arguments; unbinding uses -u. The underlying bindprocessor() enforces this , with the AIX scheduler maintaining high dispatcher probability to the last-used processor unless explicitly rebound, enhancing locality in environments.

Windows Systems

In Windows NT-based systems, processor affinity allows developers and administrators to control which logical processors a or can execute on, using bitmask-based mechanisms to optimize performance in multiprocessor environments. This feature is particularly useful for applications requiring low-latency execution or cache locality, such as real-time systems or tasks. The implementation relies on the Windows kernel scheduler, which enforces affinity masks to restrict thread migration across processors. The primary Win32 APIs for managing processor affinity are SetProcessAffinityMask and SetThreadAffinityMask. The SetProcessAffinityMask function sets an affinity mask for all threads within a specified , represented as a bit vector where each bit corresponds to a logical ; this mask must be a of the system's available processors. Similarly, SetThreadAffinityMask applies an affinity mask to an individual , ensuring it only runs on designated processors, which must also be a of the 's affinity. These functions are available in kernel32.dll and have been part of Windows since early versions, but they are generally recommended for specific scenarios like or hardware-specific optimizations due to potential impacts on load balancing. For systems with more than 64 logical processors, and later introduce processor groups to extend affinity support beyond a single 64-bit mask. The GROUP_AFFINITY structure enables this by specifying a processor group number and a 64-bit mask within that group, allowing threads to be assigned across multiple groups (up to 256 groups, each with up to 64 processors). Functions like SetThreadGroupAffinity use this structure to set group-specific affinities, ensuring compatibility with large-scale servers. This architecture was first supported in 64-bit editions of and Server 2008 R2 but matured in for broader application use. Windows provides graphical and scripting tools for managing affinity without direct API calls. In Task Manager, users can set per-process affinity via the Details tab by right-clicking a process and selecting "Set affinity," which displays available logical processors (including group distinctions on large systems) and allows selection of a subset; this change applies immediately but may require administrative privileges. For automation, PowerShell leverages the .NET System.Diagnostics.Process class, where the ProcessorAffinity property can be set on a retrieved process object (e.g., $process.ProcessorAffinity = New-Object System.IntPtr(0x1) to bind to the first processor), enabling scripted affinity adjustments for running processes. These tools integrate with the underlying APIs and are commonly used for troubleshooting or tuning in enterprise environments. As of (released in 2021 and updated through 2025), support for hybrid CPU topologies has been enhanced through integration with Intel Thread Director technology on 12th-generation Core processors and later (e.g., and subsequent architectures with performance cores [P-cores] and efficiency cores [E-cores]). This allows settings to work alongside the OS scheduler's intelligent thread placement, directing latency-sensitive tasks to P-cores while respecting user-defined masks; however, overriding scheduler hints via APIs may reduce the benefits of hybrid optimization. and collaborated on this feature to improve overall system efficiency on heterogeneous cores.

Other Platforms

In operating systems, processor affinity is crucial for ensuring deterministic behavior and minimizing in multi-core environments. , a widely used RTOS developed by Wind River, supports hard binding through its APIs for task CPU affinity, allowing developers to assign tasks to specific CPU cores or permit migration across cores for optimized performance in embedded systems. This mechanism helps in partitioning workloads to avoid interference, particularly in safety-critical applications like and automotive controls. QNX Neutrino, another prominent RTOS, implements processor affinity using the ThreadCtl() function with the _NTO_TCTL_RUNMASK command, which sets a runmask to restrict thread execution to designated processors or clusters. This POSIX-inspired approach enables fine-grained control over thread placement, supporting features like inherit masks for child threads and integration with adaptive partitioning for resource isolation in multicore setups. By default, allows () with affinity to balance predictability and load distribution. On mainframes running , processor affinity is managed at the hardware and levels through PR/SM (Processor Resource/System Manager) for logical partitioning (LPAR), where CPUs can be dedicated or shared across partitions to enforce affinity and isolation. Runtime adjustments involve commands like VARY PROCESSOR to online or offline logical CPUs, influencing dispatcher affinity for workloads, though user-level binding is limited compared to general-purpose OSes. Emerging systems up to 2025, such as the Rust-based OS, continue under active development with multicore support, though full implementation remains experimental. Similarly, provides limited native support for processor affinity via sched_setaffinity() in its derivative, primarily for foreground processes or native libraries, but restrictions on thread-level control and security policies constrain its use in mobile multi-core optimization. This enables basic big.LITTLE core management but prioritizes battery efficiency over explicit user binding.

Advanced Applications

Simultaneous Multithreading Integration

In (SMT) systems, processor affinity must account for the distinction between physical cores and the logical processors they support, as logical processors share critical hardware resources such as execution units, caches, and pipelines. Binding multiple compute-intensive threads to logical processors within the same physical core can exacerbate , leading to thrashing and suboptimal utilization of the core's capabilities. This issue is particularly pronounced in workloads with high demands, where oversubscription of shared resources degrades overall throughput. To address these challenges, best practices emphasize binding threads to distinct physical cores to isolate workloads and prevent contention on shared resources. For instance, Intel's Thread Affinity Interface enables explicit binding of threads to physical processing units, ensuring execution is restricted to non-overlapping hardware contexts. Similarly, in systems, affinity settings prioritize physical core allocation to maximize SMT efficiency without intra-core interference. Common strategies involve constructing CPU affinity masks that exclude hyperthreads, such as binding to even-numbered logical cores (e.g., 0, 2, 4) under typical configurations where pairs like 0-1 and 2-3 map to a single physical core. In environments, the sched_setaffinity facilitates this by setting a bitmask on logical CPU IDs, while sched_getaffinity retrieves the current binding; developers often combine these with topology information from /proc/cpuinfo or lscpu to identify physical cores accurately. This approach allows fine-grained control, distinguishing logical IDs while enforcing physical isolation. Performance evaluations demonstrate that such isolation strategies yield measurable benefits in SMT-enabled systems.

Modern Developments and Tools

In recent years, the Hardware Locality (hwloc) library has evolved to enhance topology-aware processor affinity management across diverse hardware platforms. Released in August 2025, hwloc version 2.12.2 provides improved detection for processors via leaf 0x80000026, enabling more precise binding of threads and processes to cores, caches, and NUMA nodes. This portable supports CPU and memory binding on various operating systems, abstracting hierarchical topologies to facilitate efficient settings in applications. Complementing hwloc, the numactl utility remains a cornerstone for implementing NUMA-aware policies, including processor affinity through options like --physcpubind, which restricts processes to specific CPUs. Post-2020 releases, such as version 2.0.16, have maintained binary compatibility in its libnuma library while supporting persistent policies for shared memory and process scheduling on Linux systems. These features allow administrators to enforce affinity for performance-critical workloads, such as high-throughput computing, by aligning processes with local memory domains. A notable 2025 advancement in scheduler technology is the SchedCP framework, which leverages (LLM) agents for autonomous optimization of scheduling policies, including dynamic adjustments via the sched-ext . Introduced in 2025, SchedCP acts as a that profiles workloads, traces performance, and validates changes to enable AI-driven tuning, reducing manual intervention in multi-core environments. This approach addresses semantic gaps in traditional schedulers by allowing LLMs to select and parameterize policies like EEVDF or SCX, potentially improving for heterogeneous tasks in data centers. Processor affinity has seen deepened integration with containerization platforms, exemplified by Docker's --cpuset-cpus flag, which leverages Linux cgroups to confine containers to designated CPU sets, enforcing strict affinity at runtime. This mechanism accepts comma-separated lists or ranges (e.g., --cpuset-cpus="0-3") to limit access to specific cores, optimizing resource isolation in multi-tenant environments without requiring host-level modifications. In cloud infrastructures, Amazon EC2 has enhanced virtual NUMA support through CPU options that allow customization of vCPU counts and thread disabling, enabling affinity control on large instances like r7iz, where improved NUMA locality boosts memory-bound workloads. Users can pin processes to NUMA nodes via OS tools on supported configurations. Emerging research trends emphasize for dynamic adjustments in data centers, aiming to automate tuning and minimize in large-scale deployments. models have been applied to predictive CPU resource provisioning, dynamically reallocating based on workload patterns to balance and performance. For example, a 2025 study demonstrated RL-driven scheduling that optimizes CPU usage in environments, reducing completion times by adapting bindings in without exhaustive manual configuration. These methods, often integrated with metaheuristics, prioritize seminal approaches like deep RL for scalable in NUMA systems, fostering reduced overhead in AI-accelerated infrastructures.

References

  1. [1]
    CPU Affinity | Linux Journal
    Jul 1, 2003 · The ability in Linux to bind one or more processes to one or more processors, called CPU affinity, is a long-requested feature.Missing: paper | Show results with:paper<|control11|><|separator|>
  2. [2]
    Operating Systems: CPU Scheduling
    2 Processor Affinity. Processors contain cache memory, which speeds up repeated accesses to the same memory locations. If a process were to switch from one ...
  3. [3]
    Affinity - NERSC Documentation
    Process affinity (or CPU pinning) means to bind each MPI process to a CPU or a range of CPUs on the node. It is important to spread MPI processes evenly ...
  4. [4]
    An in-depth analysis of the impact of processor affinity on network ...
    Previous works have shown that in general, performance can be improved by careful affinity of processes/threads to processors in a SMP system.
  5. [5]
    CPU Affinity | BSC Support Knowledge Center
    CPU affinity refers to binding a process (in Slurm --ntasks) or a thread to a specific core or set of cores. Users can enhance performance by reducing latency ...Missing: science | Show results with:science
  6. [6]
    The Case of Unsustainable CPU Affinity - ACM Digital Library
    This paper explores the tension between CPU affinity and sustainability. In particular, affinity settings can lead to significant uneven aging of cores on a CPU ...
  7. [7]
    Multiple Processors - Win32 apps - Microsoft Learn
    Jul 14, 2025 · The affinity mask is the size of the maximum number of processors in the system, with bits set to identify a subset of processors. Initially, ...
  8. [8]
    Processor affinity, clusters, runmasks, and inherit masks - QNX
    This is done through processor affinity , the ability to associate a thread with a particular processor or cluster of processors. A cluster is a group of ...
  9. [9]
    The implications of cache affinity on processor scheduling for ...
    These experiments lead us to conclude that on current machines processor affinity has only a very weak influence on the choice of scheduling discipline, and ...
  10. [10]
    [PDF] Processor Affinity or Bound Multiprocessing? - QNX
    Symmetric multiprocessing dates back several decades, but its advent is intimately linked to the increased availability of multicore chips in the mid 1990s. It ...<|separator|>
  11. [11]
    31. Symmetric Multiprocessing (SMP) - RTEMS Documentation Project
    Affinity is used to specify the subset of processors in an SMP system on which a particular task can execute. By default, tasks have an affinity which allows ...Missing: origin | Show results with:origin
  12. [12]
  13. [13]
    Performance of an OLTP application on symmetry multiprocessor ...
    Sequent's Symmetry Series is a bus-based shared-memory multiprocessor. ... Processor affinity was combined with reductions in message-passing within the database.<|separator|>
  14. [14]
    Server Configuration: affinity mask - SQL - Microsoft Learn
    Aug 26, 2025 · SQL Server supports processor affinity with two affinity mask options: affinity mask (also known as CPU affinity mask) and affinity I/O mask.
  15. [15]
    Chapter 6. Affinity | Red Hat Enterprise Linux for Real Time | 7
    Affinity is represented as a bitmask, where each bit in the mask represents a CPU core. If the bit is set to 1, then the thread or interrupt may run on that ...
  16. [16]
    The implications of cache affinity on processor scheduling for ...
    We have addressed the influence of processor affinity on processor scheduling in multiprogrammed, shared memory multiprocessors. Such affinity is acquired by.<|control11|><|separator|>
  17. [17]
    Processor Affinity Under WOW64 - Win32 apps - Microsoft Learn
    Aug 19, 2020 · The affinity mask is obtained by performing a bitwise OR operation of the top 32 bits of the mask with the low 32 bits. Therefore, if a thread ...
  18. [18]
    Processor affinity and binding - IBM
    Processor affinity is the probability of dispatching of a thread to the processor that was previously executing it. The degree of emphasis on processor ...
  19. [19]
    Chapter 9. Affinity in RHEL for Real Time - Red Hat Documentation
    Child processes inherit the CPU affinities of their parents. The real-time practice for tuning affinities on a system is to determine the number of cores ...
  20. [20]
  21. [21]
    CPU Affinity
    The ability in Linux to bind one or more processes to one or more processors, called CPU affinity, is a long-requested feature. The idea is to say ``always run ...
  22. [22]
    Untitled
    Concerned about the scalability of multithreaded network servers powered by Linux, we investigate improvements to the Linux scheduler.� We focus on pre- ...
  23. [23]
    Benefits of cache-affinity scheduling in shared-memory ...
    However, by encouraging processes to return to the CPUS on which they last ran, we eliminate asignificant amount of misses and improve the performance by 8%.
  24. [24]
    (PDF) Evaluating CPU and Memory Affinity for Numerical Scientific ...
    In this paper, we evaluate CPU and memory affinity strategies for numerical scientific multithreaded benchmarks on multi-core platforms. We use and analyze ...
  25. [25]
    9 Database Resource Management - Oracle Help Center
    This results from operating system context switching between Oracle server processes when the number of server processes is high. ... processor affinity increases ...
  26. [26]
    [PDF] Multiprocessor Real-Time Scheduling with Arbitrary Processor ...
    For example, Linux provides the system call sched setaffinity(), which allows the processor affinity of a process or a thread to be specified, with the ...
  27. [27]
    Performance tuning at the edge using Cache Allocation Technology
    Sep 8, 2023 · Using Cache Allocation Technology (CAT) improves application performance by assigning CPU affinity to cache ways, which can be dedicated to real-time ...
  28. [28]
    Potential Issues with CPU Affinity - TechDocs - Broadcom Inc.
    Apr 22, 2025 · Potential issues with CPU affinity include: For multiprocessor systems,. ESXi. systems perform automatic load balancing. Avoid manual ...
  29. [29]
    [PDF] Improving Network Connection Locality on Multicore Systems
    the Linux process load balancer can move between cores to address a load imbalance. ... Enabling load balancing reduces the median latency to. 230ms, and ...
  30. [30]
    Thread Affinity - an overview | ScienceDirect Topics
    Basically, there is a fundamental conflict between affinity and load balancing. ... The thread scheduler keeps track of the load on every CPU in the system ...
  31. [31]
  32. [32]
    Measure the Impact of NUMA Migrations on Performance - Intel
    Aug 26, 2019 · Read how NUMA (non-uniform memory access) performance can actually hurt performance if a single application is using the entire machine.<|separator|>
  33. [33]
    [PDF] Linux Support for NUMA Hardware
    Remote to local memory latency ratios range from 10:1 to 20:1. Each node has a large remote cache which helps compensate for the large remote memory latencies.
  34. [34]
    An Overview of Non-Uniform Memory Access
    Sep 1, 2013 · Nodes have an affinity to processors and to devices. These are the devices that can use memory on a NUMA node with the best performance since ...
  35. [35]
    numactl(8) - Linux manual page - man7.org
    --membind=nodes, -m nodes Only allocate memory from nodes. Allocation will fail when there is not enough memory available on these nodes. nodes may be specified ...
  36. [36]
    [PDF] Optimizing Applications for NUMA - Intel
    processor affinity and data placement. Today's complex operating systems assign application threads to processor cores using a scheduler.
  37. [37]
    NUMA Balancing: can it be cgroup-aware? | linux - Oracle Blogs
    May 28, 2025 · NUMA (Non-Uniform Memory Access) balancing is a feature ( CONFIG_NUMA_BALANCING=y ) in the Linux kernel, designed to automatically optimize task ...Missing: 6 affinity
  38. [38]
    Intel Sub-NUMA Clustering Will Stop Clashing With Resource ...
    Jul 16, 2024 · Well, with the Linux 6.11 kernel that's finally being addressed. SNC allows partitioning the CPU cores / L3 cache / memory into multiple NUMA ...
  39. [39]
    sched_setaffinity(2) - Linux manual page - man7.org
    sched_setaffinity() sets the CPU affinity mask of the thread whose ID is pid to the value specified by mask. If pid is zero, then the calling thread is used.
  40. [40]
    taskset(1) - Linux manual page - man7.org
    The taskset command is used to set or retrieve the CPU affinity of a running process given its pid, or to launch a new command with a given CPU affinity.Missing: cgroup | Show results with:cgroup
  41. [41]
    CPUSETS - The Linux Kernel documentation
    Cpusets use the generic cgroup subsystem described in Control Groups. Requests by a task, using the sched_setaffinity(2) system call to include CPUs in its CPU ...
  42. [42]
    Linux_6.1 - Linux Kernel Newbies
    Dec 12, 2022 · Summary of the changes and new features merged in the Linux kernel during the 6.1 development cycle.
  43. [43]
    processor_bind - man pages section 2: System Calls
    The processor_bind() function binds the LWP (lightweight process) or set of LWPs specified by idtype and id to the processor specified by new_binding.Missing: Illumos | Show results with:Illumos
  44. [44]
    Is it still possible to set thread affinity in macOS? - Stack Overflow
    Nov 4, 2023 · I think this piece of code should work in the older version of macOS to set the thread affinity, but I end up getting error code 46 in my M1 MacBook.How to create threads only on performance cores in MAC OSX on ...Is it possible to set pthread CPU affinity in OS X? - Stack OverflowMore results from stackoverflow.com
  45. [45]
    bindprocessor Command - IBM
    The `bindprocessor` command binds or unbinds a process's kernel threads to a processor, or lists available processors. It binds kernel threads, not the process ...Missing: affinity | Show results with:affinity
  46. [46]
    SetProcessAffinityMask function (winbase.h) - Win32 apps
    Jan 26, 2022 · A process affinity mask is a bit vector in which each bit represents a logical processor on which the threads of the process are allowed to run.
  47. [47]
    SetThreadAffinityMask function (winbase.h) - Win32 apps
    Jan 27, 2022 · A thread affinity mask is a bit vector in which each bit represents a logical processor that a thread is allowed to run on.Syntax · Return Value · Remarks
  48. [48]
    GROUP_AFFINITY structure (winnt.h) - Win32 apps - Microsoft Learn
    Feb 22, 2024 · The GROUP_AFFINITY structure represents a processor group-specific affinity, such as a thread's affinity, and includes a Mask, Group, and ...
  49. [49]
    Processor Groups - Win32 apps - Microsoft Learn
    Jul 14, 2025 · If the process is running in a single group, it can read and modify its affinity using GetProcessAffinityMask and SetProcessAffinityMask ...
  50. [50]
    Task Manager displays incorrect processor affinity - Windows Server
    Jan 15, 2025 · When you use Task Manager to set process affinity in Windows Server 2022, the processors might show processor groups incorrectly.
  51. [51]
    Process.ProcessorAffinity Property (System.Diagnostics)
    When you set the ProcessorAffinity value to zero, the operating system's scheduling algorithms set the thread's affinity. When the ProcessorAffinity value is ...
  52. [52]
    【VxWorks 7多核虚拟测试】:优化多核心性能的最佳实践 - CSDN文库
    Jan 8, 2025 · ... taskAffinitySet 函数可以设置任务对特定CPU核心的亲和性。这允许任务固定在某一核心上运行,或者在核心间迁移。 STATUS taskAffinitySet(; int tid ...
  53. [53]
    ThreadCtl(), ThreadCtl_r(), ThreadCtlExt(), ThreadCtlExt_r() - QNX
    Set the processor affinity for the calling thread in a multiprocessor system. The data is the affinity mask (or runmask ), a uint64_t that you cast to be a void ...
  54. [54]
    [PDF] Sharing CPUs: How z/OS and PR/SM Manage Logical and Physical ...
    Sep 15, 2023 · Inside your mainframe there are physical CPUs, but in almost all cases z/OS gets logical CPUs to run work on. This distinction is sometimes.
  55. [55]
    VARY PROCESSOR - IBM
    As soon as a secondary processor of that type is varied online, CPU affinity will be unsuppressed. A resource pool that limits a secondary processor type (like ...
  56. [56]
    Rust-Written Redox OS Enables Multi-Threading By Default - Phoronix
    Oct 6, 2025 · The Rust-written Redox operating system written from scratch is now enabling multi-threaded support by default for x86-based systems.
  57. [57]
    Is it possible to set affinity with sched_setaffinity in Android?
    Sep 19, 2011 · It should be possible to use the sched_setaffinity/sched_getaffinity functions, but when I compile with the NDK, I get errors complaining that the cpu_set_t ...Ocassional "Invalid argument" with sched_setaffinity on the Android ...Android set thread affinity - Stack OverflowMore results from stackoverflow.com
  58. [58]
    [PDF] Addressing Shared Resource Contention in Multicore Processors ...
    We do not present results for the default Linux scheduler because when the scheduler is given a processor affinity mask to use only four cores out of eight ...
  59. [59]
    Thread Affinity Interface - Intel
    The Intel Thread Affinity Interface binds OpenMP threads to physical processing units, restricting thread execution to a subset of processing units.
  60. [60]
    SMT Performance Benchmarks Continue To Show Benefit With AMD ...
    Aug 2, 2024 · AMD has asserted Simultaneous Multi-Threading (SMT) is still beneficial and supported across both their Zen 5 and Zen 5C cores.
  61. [61]
    Portable Hardware Locality (hwloc) - Open MPI
    Aug 26, 2025 · The latest hwloc releases are available on the download page. The GIT repository is also accessible for online browsing or checkout. The version ...Documentation · Best of lstopo · Git access · TutorialsMissing: 2020-2025 | Show results with:2020-2025
  62. [62]
    hwloc: NEWS - Fossies
    Aug 20, 2025 · Add support for new AMD CPUID leaf 0x80000026 for better detection of Core Complex and Die on Zen4 processors. Improve Zhaoxin CPU topology ...
  63. [63]
    numactl/numactl: NUMA support for Linux - GitHub
    Simple NUMA policy support. It consists of a numactl program to run other programs with a specific NUMA policy and a libnuma shared library.Releases 42 · Numactl · Issues 14 · Security
  64. [64]
    Towards Agentic OS: An LLM Agent Framework for Linux Schedulers
    We introduce SchedCP, the first framework that enables fully autonomous Large Language Model (LLM) agents to safely and efficiently optimize ...
  65. [65]
    SchedCP - Automatically Optimize Linux Scheduler with MCP Server
    Oct 5, 2025 · SchedCP is an experimental project that enables AI optimization of Linux kernel schedulers using the sched-ext framework.
  66. [66]
    Resource constraints - Docker Docs
    Docker provides ways to control how much memory, or CPU a container can use, setting runtime configuration flags of the docker run command.
  67. [67]
  68. [68]
    Amazon EC2 r7iz Instances
    Amazon EC2 R7iz instances have a new smaller bare metal size with better NUMA affinity that provides excellent throughput for our workloads, simplifies ...Missing: virtual | Show results with:virtual
  69. [69]
    CPU options for Amazon EC2 instances - AWS Documentation
    Learn how to configure CPU cores and threads to optimize your Amazon EC2 instance for specific workloads or business needs.Missing: NUMA 2020-2025
  70. [70]
    New General Purpose, Compute Optimized, and Memory-Optimized ...
    Nov 28, 2022 · You can control processor affinity (and take advantage of NUMA) on the 24xlarge and 32xlarge instances. Networking – Elastic Network Adapter ( ...
  71. [71]
    Reinforcement Learning for Dynamic and Predictive CPU Resource ...
    This paper explores the use of Reinforcement Learning (RL) for adaptive CPU resource management, offering a dynamic, data-driven approach to optimizing resource ...Missing: affinity | Show results with:affinity
  72. [72]
    An effective scheduling in data centres for efficient CPU usage and ...
    In this paper, efficient minimum execution and completion time scheduling are accomplished by using a machine learning approach for effectual CPU usage and ...Missing: affinity | Show results with:affinity
  73. [73]
    Reinforcement learning for data center energy efficiency optimization
    Jul 1, 2025 · In this systematic review, we explore the application of RL/DRL algorithms for optimizing data center energy efficiency.Missing: affinity | Show results with:affinity