Performance Guidelines for AMD Athlon™ 64 and AMD Opteron™

40555 Rev. 3.00 June 2006

ccNUMA Multiprocessor Systems

 

A.7 Tools and APIs for Thread/Process and Memory Placement (Affinity) for AMD64 ccNUMA Multiprocessor Systems

This following sections discuss tools and APIs available for assigning thread/process and memory affinity under various operating systems.

A.7.1 Support Under Linux®

Linux provides command-line utilities to explicitly set process/thread and meory affinity to both nodes and cores on a node[5]. Additionally, libnuma, a shared library, is provided for more precise

affinity control from within applications.

Controlling Process and Thread Affinity

The Linux command-line utlities offer high-level affinity control options. The numactl utility is a command line tool for running a process with a specific node affinity.

For example, to run the foobar program on the cores of node 0, enter the following at the command prompt:

numactl --cpubind=0 foobar

Application and kernel developers can use the libnuma shared library, which can be linked to programs and offers a stable API for setting thread affinity to a given node or set of nodes. Interested developers should consult the Linux man pages for details on the various functions available.

On a dual-core processor, a node has more than one core. If a process or thread is affined to a particular node using the tools or API discussed above, it may still migrate back and forth between the two cores of that node. This migration may or may not affect performance.

The taskset utility is a command-line tool for setting the process affinity for a specified program to any core. For example, to run program foobar on the two cores of node 0, enter the following on the command line:

taskset -c 0,1 foobar

In SuSE Linux Enterprise Server 10/10.1, the numactl utility can be used instead of taskset to set process affinity to any core.

Linux provides several functions by which to set the thread affinity to any core or set of cores:

pthread_attr_setaffinity_np( ) and pthread_create( ) are provided as a part of the older nptl library; they can be used to set the affinity parameter and then create a thread using that affinity.

sched_setaffinity( ) system call and schedutils scheduler utilities.

44

Appendix A

Page 44
Image 44
AMD 64 manual Support Under Linux, Controlling Process and Thread Affinity

64 specifications

AMD64 is a 64-bit architecture developed by Advanced Micro Devices (AMD) as an extension of the x86 architecture. Introduced in the early 2000s, it aimed to offer enhanced performance and capabilities to powering modern computing systems. One of the main features of AMD64 is its ability to address a significantly larger amount of memory compared to its 32-bit predecessors. While the old x86 architecture was limited to 4 GB of RAM, AMD64 can theoretically support up to 16 exabytes of memory, making it ideal for applications requiring large datasets, such as scientific computing and complex simulations.

Another key characteristic of AMD64 is its support for backward compatibility. This means that it can run existing 32-bit applications seamlessly, allowing users to upgrade their hardware without losing access to their existing software libraries. This backward compatibility is achieved through a mode known as Compatibility Mode, enabling users to benefit from both newer 64-bit applications and older 32-bit applications.

AMD64 also incorporates several advanced technologies to optimize performance. One such technology is the support for multiple cores and simultaneous multithreading (SMT). This allows processors to handle multiple threads concurrently, improving overall performance, especially in multi-tasking and multi-threaded applications. With the rise of multi-core processors, AMD64 has gained traction in both consumer and enterprise markets, providing users with an efficient computing experience.

Additionally, AMD64 supports advanced vector extensions (AVX), which enhance the capability of processors to perform single instruction, multiple data (SIMD) operations. This is particularly beneficial for tasks such as video encoding, scientific simulations, and cryptography, allowing these processes to be executed much faster, thereby increasing overall throughput.

Security features are also integrated within AMD64 architecture. Technologies like AMD Secure Execution and Secure Memory Encryption help protect sensitive data and provide an enhanced security environment for virtualized systems.

In summary, AMD64 is a powerful and versatile architecture that extends the capabilities of x86, offering enhanced memory addressing, backward compatibility, multi-core processing, vector extensions, and robust security features. These innovations have positioned AMD as a strong competitor in the computing landscape, catering to the demands of modern users and applications. The continuous evolution of AMD64 technology demonstrates AMD's commitment to pushing the boundaries of computing performance and efficiency.