numa 2.2 KB

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