Explicit NUMA Optimizations
All the local memory and affinity rules cannot help out if all threads on all the nodes need access to the same memory regions.
It is, of course, possible to simply re...
Querying Node Information
The get_mempolicy interface can be used to query a variety of facts about the state of NUMA for a given address.
#include <numaif.h>
long get_mempolicy(int *policy...
Swapping and Policies
If physical memory runs out, the system has to drop clean pages and save dirty pages to swap.
The Linux swap implementation discards(丢弃) node information when it writes page...
Memory Policy
The idea behind defining a memory policy is to allow existing code to work reasonably well in a NUMA environment without major modifications.
The policy is inherited by child proces...
NUMA
For NUMA programming everything said so far about cache optimizations applies as well.
The differences only start below that level.
NUMA introduces different costs when accessing different ...
Multi-Thread Optimizations
When it comes to multi-threading, there are three different aspects of cache use which are important:
Concurrency
Atomicity
Bandwidth
T...
Bandwidth Considerations
When many threads are used, and they do not cause cache contention by using the same cache lines on different cores, there still are potential(潜在的) problems.
Each process...
Atomicity Optimizations
If multiple threads modify the same memory location concurrently, processors do not guarantee any specific result(处理器不保证任何特定结果).
This is a deliberate(商榷) decision made to ...