blob: e93ad9425e2a162b949b015c53da2b155a897b29 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001Started Nov 1999 by Kanoj Sarcar <kanoj@sgi.com>
2
3The intent of this file is to have an uptodate, running commentary
4from different people about NUMA specific code in the Linux vm.
5
6What is NUMA? It is an architecture where the memory access times
7for different regions of memory from a given processor varies
8according to the "distance" of the memory region from the processor.
9Each region of memory to which access times are the same from any
10cpu, is called a node. On such architectures, it is beneficial if
11the kernel tries to minimize inter node communications. Schemes
12for this range from kernel text and read-only data replication
13across nodes, and trying to house all the data structures that
14key components of the kernel need on memory on that node.
15
16Currently, all the numa support is to provide efficient handling
17of widely discontiguous physical memory, so architectures which
18are not NUMA but can have huge holes in the physical address space
19can use the same code. All this code is bracketed by CONFIG_DISCONTIGMEM.
20
21The initial port includes NUMAizing the bootmem allocator code by
22encapsulating all the pieces of information into a bootmem_data_t
23structure. Node specific calls have been added to the allocator.
24In theory, any platform which uses the bootmem allocator should
Paolo Ornati670e9f32006-10-03 22:57:56 +020025be able to put the bootmem and mem_map data structures anywhere
Linus Torvalds1da177e2005-04-16 15:20:36 -070026it deems best.
27
28Each node's page allocation data structures have also been encapsulated
29into a pg_data_t. The bootmem_data_t is just one part of this. To
30make the code look uniform between NUMA and regular UMA platforms,
31UMA platforms have a statically allocated pg_data_t too (contig_page_data).
32For the sake of uniformity, the function num_online_nodes() is also defined
33for all platforms. As we run benchmarks, we might decide to NUMAize
34more variables like low_on_memory, nr_free_pages etc into the pg_data_t.
35
36The NUMA aware page allocation code currently tries to allocate pages
37from different nodes in a round robin manner. This will be changed to
38do concentratic circle search, starting from current node, once the
39NUMA port achieves more maturity. The call alloc_pages_node has been
40added, so that drivers can make the call and not worry about whether
41it is running on a NUMA or UMA platform.