📄 numa
字号:
Started Nov 1999 by Kanoj Sarcar <kanoj@sgi.com>The intent of this file is to have an uptodate, running commentary from different people about NUMA specific code in the Linux vm.What is NUMA? It is an architecture where the memory access timesfor different regions of memory from a given processor variesaccording to the "distance" of the memory region from the processor.Each region of memory to which access times are the same from any cpu, is called a node. On such architectures, it is beneficial ifthe kernel tries to minimize inter node communications. Schemesfor this range from kernel text and read-only data replicationacross nodes, and trying to house all the data structures thatkey components of the kernel need on memory on that node.Currently, all the numa support is to provide efficient handlingof widely discontiguous physical memory, so architectures which are not NUMA but can have huge holes in the physical address spacecan use the same code. All this code is bracketed by CONFIG_DISCONTIGMEM.The initial port includes NUMAizing the bootmem allocator code byencapsulating all the pieces of information into a bootmem_data_tstructure. Node specific calls have been added to the allocator. In theory, any platform which uses the bootmem allocator should be able to to put the bootmem and mem_map data structures anywhereit deems best.Each node's page allocation data structures have also been encapsulatedinto a pg_data_t. The bootmem_data_t is just one part of this. To make the code look uniform between NUMA and regular UMA platforms, UMA platforms have a statically allocated pg_data_t too (contig_page_data).For the sake of uniformity, the variable "numnodes" is also definedfor all platforms. As we run benchmarks, we might decide to NUMAize more variables like low_on_memory, nr_free_pages etc into the pg_data_t.The NUMA aware page allocation code currently tries to allocate pages from different nodes in a round robin manner. This will be changed to do concentratic circle search, starting from current node, once the NUMA port achieves more maturity. The call alloc_pages_node has been added, so that drivers can make the call and not worry about whether it is running on a NUMA or UMA platform.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -